Overrides
Input
Text input with size variants and a commit callback for blur and Enter.
Extended Features
- Size variants —
xs,sm,default, andlgwith the same dimensions and spacing as the Button component - Commit value —
onCommitValuefires when the user blurs the field or presses ↵, separate fromonChangewhile typing
Commit value
Use onChange for every keystroke and onCommitValue when the user finishes editing (blur or
↵). The handler receives a synthetic change event with the current value, matching the
shape of onChange. Repeated commits with the same value are skipped until the field changes again.
Key bindings
| Key | Behavior |
|---|---|
| ↵ | Fires onCommitValue with the current value (preventDefault on Enter). |
blur | Fires onCommitValue when focus leaves the input (unless defaultPrevented or disabled). |
Custom props
| Prop | Type | Description |
|---|---|---|
onCommitValue | React.ChangeEventHandler<HTMLInputElement> | Fires on blur and ↵ when the value changes since the last commit. |
size | 'xs' | 'sm' | 'default' | 'lg' | Height and padding aligned with Button. |
Install
Configure your registry in components.json:
{
"registries": {
"@uxio": "https://ui.uxio.dev/r/styles/{style}/{name}.json"
}
}Then run:
npx shadcn@latest add @uxio/inputUsage
"use client"
import * as React from "react"
import { Input } from "@/components/ui/input"
export function NameField() {
const [text, setText] = React.useState("")
const [committed, setCommitted] = React.useState("")
return (
<Input
value={text}
placeholder="Your name"
onChange={(event) => setText(event.target.value)}
onCommitValue={(event) => setCommitted(event.target.value)}
/>
)
}Examples
Commit value
Visible text (onChange): —
Committed value (onCommitValue): —
Size Variants
Use the size prop to match input dimensions with the Button component. Sizes align across all
styles.