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.

Enter a full email address, like alex@northwindlabs.co.
Shown to people you email.

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.

Create one in your Apple account settings.

Usage

import { Input } from "@kuori/ui/fields";
<Input label="Email address" placeholder="johndoe@gmail.com" size="sm" />

Input Properties

PropTypeDescription
label
ReactNode
The visible label above the field. Every field has one
hint
ReactNode
Helper text under the field, in text/secondary
error
ReactNode
The message shown under the field while it's invalid
invalid
boolean
Danger outline and halo, and shows the errorDefault: false
size
'sm''md''lg'
sm 38, md 42, lg 46 tall. Forms use sm, next to Button lgDefault: md
value
string
The value, when the field is controlled
defaultValue
string
The starting value, when it isn't
onChange
(value: string) => void
Called with the new value, never the event
placeholder
string
A hint inside the empty field, never a stand-in for the label
disabled
boolean
fill/disabled with text/disabledDefault: false
readOnly
boolean
Shows the value without letting it changeDefault: false
leading
ReactNode
A mark at the start of the field, like an icon
trailing
ReactNode
A mark at the end, or an inline selector
prefix
ReactNode
Text read as part of the value, at the start: a unit or protocol
suffix
ReactNode
Text read as part of the value, at the end
classNames
Partial<Record<InputPart, string>>
Classes for each part of the field
className
string
Additional CSS classes to apply to the field's root