HextaUI

Input: Disabled

A disabled input can’t be focused, edited or submitted with the form.

import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"

export function InputDisabled() {
  return (
    <div className="flex w-full max-w-sm flex-col gap-2">
      <Label htmlFor="input-disabled">Workspace</Label>
      <Input id="input-disabled" defaultValue="Acme Inc." disabled />
    </div>
  )
}

This adds the example as components/examples/input/disabled.tsx, together with the Input component and the HextaUI theme tokens it needs.

pnpm dlx shadcn@latest add https://hextaui.com/r/input-disabled.json

To add only the component, follow the Input installation.

Props in this example

The Input props this example sets, from the API reference.

PropTypeDefault
defaultValue
string | number | string[]–
disabled
booleanfalse

Every prop is in the Input API reference.

See them all, with keyboard support and accessibility notes, on the Input page.