Skip to main content
Glama
deleonio
by deleonio
select-range.tsx1.1 kB
import { KolButtonLink, KolInputText } from '@public-ui/react-v19'; import * as React from 'react'; import { SampleDescription } from '../SampleDescription'; export const InputTextSelectRange = () => { const textInput = React.useRef<HTMLKolInputTextElement>(null); function setSelectioStart() { textInput.current?.focus(); textInput.current?.setSelectionStart(8); } function setSelectionRange() { textInput.current?.focus(); textInput.current?.setSelectionRange(2, 5); } function setRangeText() { textInput.current?.focus(); textInput.current?.setRangeText('INSERTED', 5, 9, 'select'); } return ( <> <SampleDescription> <p>This sample shows how to change the selection in a KolInputText.</p> </SampleDescription> <div className="grid gap-4"> <KolInputText _value="Very long value" _label="Text Input Label" ref={textInput} /> <KolButtonLink _label="Set Start" onClick={setSelectioStart} /> <KolButtonLink _label="Set Range" onClick={setSelectionRange} /> <KolButtonLink _label="Set Range Text" onClick={setRangeText} /> </div> </> ); };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/deleonio/public-ui-kolibri'

If you have feedback or need assistance with the MCP directory API, please join our Discord server