0.1.0-rc.2

Input

Inputs capture single-line text, numbers, emails, and other native input types with Radiant sizing and focus styles.

Try it

Usage

Wrap inputs in RuiField for labels and validation. Set type and placeholder as needed.

import { RuiInput } from '@ecopages/radiant-ui/input';
import { RuiField } from '@ecopages/radiant-ui/field';
import { RuiLabel } from '@ecopages/radiant-ui/label';
 
<RuiField name="email">
  <RuiLabel>Email</RuiLabel>
  <RuiInput type="email" placeholder="[email protected]" />
</RuiField>

Choose the right type

Use email, url, and tel to trigger appropriate mobile keyboards. Use password for credential fields.

Marked for Field discovery

RuiInput sets data-rui-control so RuiField can wire labels, validation, and ARIA. Prefer it over a bare <input> inside forms.

Input masks

Pass a mask pattern for structured entry like phone numbers or credit card segments.

Theming

RuiInput consumes semantic surface + status roles, never Tailwind palette steps:

State / partCSS roles
Baseborder, background, on-background
Focusfocus-ring
Invalid (aria-invalid)error border
Disabledopacity-disabled

Geometry comes from control tokens: --size-control-md height, --radius-control corner, --space-control-x inline padding, the same tokens RuiButton uses, so form rows align. Override colors at the theme layer, not in component CSS.

Accessibility

  • Every input needs a visible label; placeholders are not substitutes.
  • Disabled inputs should explain why editing is unavailable.
  • Use type attributes that match the expected data format.

API

RuiInput is a presentational JSX view over a native <input>, no custom element. It sets data-rui-control so RuiField can wire labels, validation, and ARIA.

Props

PropTypeDefaultDescription
valuestringControlled value.
typestringtextNative input type (email, password, tel, …).
placeholderstringPlaceholder text.
disabledbooleanfalseDisabled state.
namestringForm field name.
idstringInput id (auto-wired by RuiField).
aria-labelstringAccessible name when there is no visible label.
maskstringIMask pattern; 0 digit, a letter, * any char, {text} fixed.
on:input / on:change / on:blur(e: Event) => voidEvent handlers.

CSS classes

Public classes on the rendered element (documented via @cssclass):

ClassDescription
.rui-inputInput root; control-height, rounded, bordered surface.

Theme roles

PartCSS variables consumed
Base--border, --background, --on-background
Focus ring--focus-ring
Invalid--error
Geometry--size-control-md, --radius-control, --space-control-x