Overrides

Input

Text input with size variants and a commit callback for blur and Enter.

Extended Features

  • Size variantsxs, sm, default, and lg with the same dimensions and spacing as the Button component
  • Commit valueonCommitValue fires when the user blurs the field or presses , separate from onChange while 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

KeyBehavior
Fires onCommitValue with the current value (preventDefault on Enter).
blurFires onCommitValue when focus leaves the input (unless defaultPrevented or disabled).

Custom props

PropTypeDescription
onCommitValueReact.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/input

Usage

"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.

Extra Small (xs)

Small (sm)

Default

Large (lg)