Input

A styled text input with optional prefix and suffix adornments.

Import

import { Input } from '@matix/components/input';

Usage

Sizes

Each size has the same height as the Select, DatePicker, and Button of the same size: 27px, 32px, and 37px. The height does not change with the font.

Prefix & Suffix

Render elements before or after the input text. The text starts after the prefix and ends before the suffix, at any adornment width.

$USD
northwind.app/

With a prefix or a suffix, a wrapper draws the field box and the <input> inside has no border or background. sx still goes to the <input>. Adornments do not take pointer events.

With Field

Wrap in a Field for label, description, and error display.

<Field label="Email" description="We'll never share your email." error={null}>
  <Input type="email" placeholder="you@example.com" />
</Field>

Disabled

Custom Styles

Use the sx prop to override styles.

import * as stylex from '@stylexjs/stylex';

const custom = stylex.create({
  rounded: { borderRadius: '9999px', paddingInline: '16px' },
});

<Input sx={custom.rounded} aria-label="Rounded input" placeholder="Rounded input" />;

API Reference

PropTypeDefaultDescription
size'sm' | 'md' | 'lg''md'Input size preset
prefixReactNode—Element rendered before the input text
suffixReactNode—Element rendered after the input text
sxStyleXStyles—StyleX style override

All other props are forwarded to the underlying <input> element via Base UI.

Accessibility

  • Wraps Base UI Input — inherits native <input> semantics.
  • Focus ring via :focus-visible CSS pseudo-class — no JS.
  • Invalid state indicated via red border driven by Base UI invalid state.
  • Always pair with Field or a visible <label> for screen reader support.

Keyboard

KeyAction
TabMoves focus into / out of the input