Skip to main content

Input

Displays an input field.

Code Example

import { Glass, TextInput } from "@coconut-xr/apfel-kruemel";
import { BoxSelect } from "@coconut-xr/lucide-koestlich";

export default function CheckboxesPage() {
const [text, setText] = useState("");
return (
<Glass borderRadius={32} padding={16} flexDirection="row" gapRow={16}>
<TextInput value={text} onValueChange={setText} style="rect" placeholder="Placeholder" />
<TextInput
value={text}
onValueChange={setText}
style="rect"
placeholder="Placeholder"
prefix={<BoxSelect />}
/>
<TextInput
value={text}
onValueChange={setText}
style="rect"
placeholder="Placeholder"
disabled
/>
<TextInput
value={text}
onValueChange={setText}
style="rect"
placeholder="Placeholder"
disabled
prefix={<BoxSelect />}
/>
</Glass>
);
}

Sandbox

Params

NameTypeAttributesDescription
styleStyleoptional / default: "rect"Style of the input field. Options are "rect" / "pill"
disabledbooleanoptionalIf true, disable all interactions for the input field
placeholderstringoptionalA short hint displayed in the input field before the user enters a value
valuestring-The value of the input field
onValueChange(value: string) => voidoptionalCallback fired when the value is changed
prefixRectNodeoptionalCustomizable prefix displayed at front of the input field