Components

Input

Single-line text input with accessible error state

Overview

Input is a single-line text input for editing a value in place. Its border stays hidden until you hover or focus it, so it blends into cards and panels.

  • States — enabled, hover, focus, disabled, invalid
  • Error Message — errorMessage shows red text below the input, marks it aria-invalid, and links the text with aria-describedby
  • Standard attributes — disabled, placeholder, readOnly, aria-* and event handlers go straight to the input element

States

Default

Disabled

Invalid

This field is required
This field is required
StateHow it looksHow to turn it on
enabledNo visible border—
hoverGray border (not while disabled or invalid)Pointer over the input
focusDark 2px border instead of the blue ringClick or Tab
disabledGray text, skipped by Tabdisabled
invalidRed border; red 2px when focusederrorMessage or aria-invalid

Error Message

errorMessage turns on the invalid state for you. Screen readers read the message after the input's name.

Title is required

The input gets aria-invalid="true", and aria-describedby points at the message's generated id.

To show the red border without a message, pass aria-invalid instead. Your own aria-describedby is kept next to the error message.

Full Width

Input fills its parent by default. Pass isFullWidth={false} to size it to its content.

Props

PropTypeDefaultRequiredDescription
isFullWidthbooleantrueNoWidth is 100% by default, so leaving it out fills the parent. false makes it auto
errorMessagestring-NoError text. When set, aria-invalid turns on and the text is linked with aria-describedby
aria-invalidboolean | 'true' | 'false'-NoShows the error look without error text. Not needed when errorMessage is set
disabledbooleanfalseNoDisabled (standard HTML attribute)
valuestring-NoValue. Passing it makes the input controlled (needs onChange); leave it out to let the browser keep the value
onChange(e: ChangeEvent<HTMLInputElement>) => void-NoCalled when the value changes
typestring''text''Noinput type
namestring-Noinput name
classNamestring-NoExtra CSS class
refRef<HTMLInputElement>-NoRef to the input element

Specification

base

상태요소속성값
enabledrootcolor$color.text.default.default
enabledrootbackgroundColor$color.background.default.default
enabledrootborderColor$color.background.default.default
enabledrootborderWidth$size.stroke.border
enabledrootborderRadius$size.radius.100
enabledrootpadding$size.space.200
enabledroottypography$text.bodyStrong
enabledrootplaceholderColor$color.text.default.secondary
enablederrorTextcolor$color.text.danger.default
enablederrorTexttypography$text.caption
enablederrorTextmarginTop$size.space.100
hoverrootborderColor$color.border.default.default
focusrootstrokeWidth$size.stroke.focus
focusrootstrokeColor$color.border.brand.default
focusrootoutlineStylenone토큰 아님 — the border shows focus instead
disabledrootcolor$color.text.disabled.default
invalidrootborderColor$color.border.danger.default

Accessibility

  • Give every input a name: a label element with htmlFor, aria-label, or aria-labelledby. A placeholder is not a name.
  • Use errorMessage rather than placing your own red text next to the input, so the message is announced.
  • Placeholder text uses text.default.secondary (4.6:1 on the default background).

Guidelines

  • Use disabled, not isDisabled. Use errorMessage or aria-invalid, not variant="error". The old names were removed.