HextaUI

Button: Disabled

focusableWhenDisabled keeps a disabled button in the tab order, so a tooltip or explanation can still be reached by keyboard.

import { Button } from "@/components/ui/button"

export function ButtonDisabled() {
  return (
    <div className="flex flex-wrap items-center justify-center gap-2">
      <Button disabled>Disabled</Button>
      <Button variant="outline" disabled focusableWhenDisabled>
        Focusable when disabled
      </Button>
    </div>
  )
}

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

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

To add only the component, follow the Button installation.

Props in this example

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

PropTypeDefault
variant
"default" | "outline" | "secondary" | "ghost" | "ghost-destructive" | "destructive" | "link""default"
disabled
booleanfalse
focusableWhenDisabledAlways true while loading.
booleanfalse

Every prop is in the Button API reference.

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