Input
Every field comes from Yöte, dressed in Kuori tokens. Never build a field from scratch.
Sizes
size is sm (38 tall, radius 12), md (42, radius 16) or lg (46, radius 20). Forms use sm, which lines up with Button lg. The default is md.
States
invalid with an error shows the danger outline and its message. hint sits under the field. disabled uses fill/disabled.
Types
Yöte has a field for each kind of value: PasswordInput, PinInput, SelectInput, DateInput, PhoneInput, TagsInput, Textarea and CardInput. They all take the same props as Input.
Usage
import { Input } from "@kuori/ui/fields";<Input label="Email address" placeholder="johndoe@gmail.com" size="sm" />Input Properties
PropTypeDescription
labelReactNodeThe visible label above the field. Every field has one
hintReactNodeHelper text under the field, in text/secondary
errorReactNodeThe message shown under the field while it's invalid
invalidbooleanDanger outline and halo, and shows the errorDefault:
falsesize'sm''md''lg'sm 38, md 42, lg 46 tall. Forms use sm, next to Button lgDefault:
mdvaluestringThe value, when the field is controlled
defaultValuestringThe starting value, when it isn't
onChange(value: string) => voidCalled with the new value, never the event
placeholderstringA hint inside the empty field, never a stand-in for the label
disabledbooleanfill/disabled with text/disabledDefault:
falsereadOnlybooleanShows the value without letting it changeDefault:
falseleadingReactNodeA mark at the start of the field, like an icon
trailingReactNodeA mark at the end, or an inline selector
prefixReactNodeText read as part of the value, at the start: a unit or protocol
suffixReactNodeText read as part of the value, at the end
classNamesPartial<Record<InputPart, string>>Classes for each part of the field
classNamestringAdditional CSS classes to apply to the field's root