Skip to content
Mosaic
On this page

Input

A single-line text input. Inside a Field it takes its id, label, description, disabled, required and invalid state from the field. Inside an InputGroup it drops its chrome and takes the group size.

Use for

  • a text, email or search field
  • the text part of an InputGroup

Practices

GuidancePractice
DoRender it inside Field.Root with a Field.Label, so it is labelled and described.
DoUse PasswordInput, PhoneInput or Otp for those values.
Don’tSet size inside an InputGroup. The group size wins.

API reference

Input

Renders an input and forwards its ref. When the field keeps a disabled control focusable, the input goes readOnly and aria-disabled instead of disabled.

Slot: cl-input

PropTypeDescription
size'sm' | 'md' | 'lg'sm, md or lg.Default: 'md'
variantInputVariantdefault draws the field chrome. ghost keeps the sizing and leaves chrome and focus to the container.Default: `ghost` inside an `InputGroup`, else `default`

Examples

A labelled input

TSX
<Field.Root>
  <Field.Label>Email</Field.Label>
  <Input type='email' autoComplete='email' />
</Field.Root>