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
| Prop | Type | Default | Description |
|---|---|---|---|
size | 'sm' | 'md' | 'lg' | 'md' | Input size preset |
prefix | ReactNode | — | Element rendered before the input text |
suffix | ReactNode | — | Element rendered after the input text |
sx | StyleXStyles | — | 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-visibleCSS pseudo-class — no JS. - Invalid state indicated via red border driven by Base UI
invalidstate. - Always pair with
Fieldor a visible<label>for screen reader support.
Keyboard
| Key | Action |
|---|---|
Tab | Moves focus into / out of the input |