Back to gallery

Text field

States in light and dark

Each panel sets its own theme scope, so the appearance control above does not change them. The two lower panels nest the opposite theme inside. Hover a field, press Tab to focus it, and read the ring.

Light theme

Phone
value: empty
Phone, outlined
value: empty

Dark theme

Phone
value: empty
Phone, outlined
value: empty

Dark theme, with a light panel inside

Phone
value: empty
Phone, outlined
value: empty

Light theme, nested in dark

Phone
value: empty
Phone, outlined
value: empty

Light theme, with a dark panel inside

Phone
value: empty
Phone, outlined
value: empty

Dark theme, nested in light

Phone
value: empty
Phone, outlined
value: empty

Sizes, gutters and pill

Heights are 22, 24, 26, 28, 32, 36, 40, 44 and 48px. The gutter size changes only the horizontal padding. Pill rounds the container and grows the gutter by 1.33.

Container press, focus and select

Press the container beside the text and the input takes focus with the caret at the start or the end. Double-click beside the text selects the nearest word, triple-click selects all. The button inside the container keeps its own press.

events: none

Other props

Optical alignment pulls the container outward by one gutter. Autofill extensions stay active when asked for. The field variant hides the number spin buttons. The focus ring can be turned off.

Textarea

Rows sets the minimum height. Auto resize grows the box with the text up to max rows, then scrolls. Resize shows the corner handle.

Tag input

Press Backspace or ArrowLeft with the caret at the start to move to the last tag. In a tag, ArrowLeft and ArrowRight move between tags, Backspace and Delete remove one. Enter in the field adds the text as a tag.

Alpha
Beta
Gamma
Alpha
Beta
Gamma
Alpha
Beta
Gamma

tags: Alpha, Beta, Gamma

Phone input

Type digits to see the national format and the E.164 value. Open the country button, type to search by name, code or dial code, move with the arrow keys and press Enter. Typing a plus sign and a calling code picks the country.

Default
value: empty
Flags
value: empty
Default country GB
value: empty
Countries US, GB, FR, DE, JP
value: empty
International option
value: empty
International
value: empty
National only
value: empty
Initial value +442079460958
value: +442079460958
Inside a menu overlay surface
value: empty
Input is not focused after a choice
value: empty
Initial value shown as local number
value: +442079460958
Outlined
value: empty
Disabled
value: +12133734253
No countriesvalue: empty

TextInput variants

Every TextInput variant with its classes. Four variants (default, field, segmented and form) are also shown with a leading control, a value suffix and a trailing control.

default
compact
field
form
onboarding
outlined
rounded
auth
code
amount
segmented
search
searchFilter
heading
inline
display
displayName
settings
ghost
plain
grouped
transparent
tags
default with controls
end
field with controls
end
segmented with controls
end
form with controls
end
mixed
%
auto size
invalid
disabled
tags, compact
OneTwo
tags, comfortable
OneTwo
tags, multiline
OneTwo

TextareaField variants

Every TextareaField variant. Auto resize and the display fit run on input. The feedback variant takes a footer and the segmented variant takes a trailing control.

default
compact
dialog
code
ghost
plain
settings
outlined
editor
comparison
rounded
display
segmented
feedback
feedback, footer

Footer text

segmented, trailing control
Send
invalid
disabled

Inline error text

The error is a plain element with role alert that exists only while the value is too long. It is announced when it appears.

Ref cleanup

The callback ref returns a cleanup. Hiding the field runs that cleanup once, not a call with null.

ref events:

Right to left

أول
ثان