Component

Input

A styled text input with size variants and validation states. Uses the headless @refraction-ui/input core.

Sizes

Three size options to fit different layout needs.

Compact size for dense layouts and inline forms.

Standard size for most form contexts.

Larger touch target for primary actions or hero inputs.

Installation

$pnpm add @refraction-ui/react-input

Usage

tsx
import { Input } from '@refraction-ui/react'

export function MyForm() {
  return (
    <form className="space-y-4">
      <Input placeholder="Your name" />
      <Input type="email" placeholder="Email address" />
      <Input type="password" placeholder="Password" />
    </form>
  )
}

Input Types

Supports standard HTML input types with appropriate behavior.

States

Disabled, read-only, required, and invalid states.

Prevents user interaction entirely.

Visible and selectable but not editable.

Browser enforces completion on form submit.

This field has a validation error.

Props

PropTypeDefaultDescription
size'sm' | 'default' | 'lg''default'Size of the input.
type'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search''text'HTML input type.
disabledbooleanfalseDisables the input.
readOnlybooleanfalseMakes the input read-only.
requiredbooleanfalseMarks the input as required.
aria-invalidboolean--Marks the input as invalid for validation feedback.
placeholderstring--Placeholder text.
classNamestring--Additional CSS classes to apply.