# Disabled Reason

> A disabled button that answers a press: it shakes, says why it's blocked, and moves focus to the field that needs fixing.

## Spec sheet

| | |
| --- | --- |
| Access | Free: no account, free for commercial use |
| Shelf | Components › State Changes |
| Live preview | https://uibrik.com/components/disabled-reason |
| Writes | 1 file into `components/uibrik/disabled-reason/` |
| Packages | `motion` (the CLI installs them) |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 22, 2026 |

## Add it

```bash
npx shadcn@latest add https://uibrik.com/r/disabled-reason.json
```

With the `@uibrik` namespace in `components.json` ([setup](https://uibrik.com/docs/installation.md)): `npx shadcn@latest add @uibrik/disabled-reason`.

Can't run commands? https://uibrik.com/components/disabled-reason/prompt.txt has every file verbatim, with the setup steps, ready for an assistant to write.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { DisabledReason } from "@/components/uibrik/disabled-reason/disabled-reason";

<DisabledReason
  children="Continue"
  reason="Add your email first"
  showFor={2.4}
  side="top"
  size="md"
  radius={12}
  disabled
  type="button"
  onClick={() => {}}
  onBlocked={() => {}}
  // targetId="…"
/>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/disabled-reason.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `children` | `string` | `"Continue"` | Button text. |
| `reason` | `string` | `"Add your email first"` | Why the button is blocked, shown on press. |
| `showFor` | `number` | `2.4` | How long the reason stays up. |
| `side` | `"top" \| "bottom"` | `"top"` | Where the reason appears. |
| `size` | `"sm" \| "md" \| "lg"` | `"md"` | Height, padding and text size. |
| `radius` | `number` | `12` | Corner radius. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `disabled` | `boolean` | `true` | Blocks the action; a press explains why instead. |
| `targetId` | `string` |  | Id of the field to fix; it takes focus and flashes a ring. |
| `onClick` | `() => void` |  | Called on press while allowed. |
| `onBlocked` | `() => void` |  | Called on press while blocked. |
| `type` | `"button" \| "submit"` | `"button"` | Button type while allowed. |
| `className` | `string` |  | Classes for the wrapper. |

## Where it fits

- **Forms with required fields**: Pressing the greyed-out button points straight at the missing field instead of doing nothing. Pairs with [Multi-step Form](https://uibrik.com/components/multi-step-form.md) (Pro) and [Auth Forms](https://uibrik.com/components/auth-forms.md) (Pro).
- **Plan and permission limits**: The reason can say a feature needs another plan or an admin, right where people tried to use it. Pairs with [Permissions Matrix](https://uibrik.com/components/permissions-matrix.md) (Pro).
- **Checkout steps**: A blocked Pay button explains what's left, like choosing a shipping option, so buyers don't stall. Pairs with [Checkout Flow](https://uibrik.com/components/checkout-flow.md) (Pro).

## Same shelf: State Changes

- [Download Button](https://uibrik.com/components/download-button.md): A download button whose arrow drops into its tray, fills with progress as the percentage counts up, then draws a check and offers Open.
- [Follow Button](https://uibrik.com/components/follow-button.md): A follow button whose plus folds into a check as it turns to Following, and warns with Unfollow on hover before you undo it.
- [Live Kbd](https://uibrik.com/components/live-kbd.md): Shortcut keycaps that sink as you press the real keys, then fire the action, so people learn the shortcut by using it.
- [Mute Toggle](https://uibrik.com/components/mute-toggle.md): A sound toggle whose waves fold away one at a time before a slash cuts through the speaker, and come back in reverse.
- [Notification Bell](https://uibrik.com/components/notification-bell.md): A notification bell that swings when something new arrives, rolls its badge count up, and drops the badge into the bell once read.
- [Password Peek](https://uibrik.com/components/password-peek.md): A password field whose eye blinks as you toggle it, and whose characters rise into view left to right instead of snapping from dots.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/disabled-reason/` so the import paths keep resolving.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
