195 Pro components and page blocks

Get Pro

Updated

Disabled Reason

New

Preview

Customize

Show for2.4s
Top
Medium
Radius12px

Installation

npx shadcn@latest add https://uibrik.com/r/disabled-reason.json
Adds the files to components/uibrik/disabled-reason and installs motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/disabled-reason.

Usage

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="…"/>

Where to use Disabled Reason

  • Forms with required fields

    Pressing the greyed-out button points straight at the missing field instead of doing nothing.

    Pairs with Multi-step Form and Auth Forms

  • 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

  • Checkout steps

    A blocked Pay button explains what's left, like choosing a shipping option, so buyers don't stall.

    Pairs with Checkout Flow

Props

DisabledReason
children
Type string
"Continue"
Button text.
reason
Type string
"Add your email first"
Why the button is blocked, shown on press.
showFor
Type number
2.4
How long the reason stays up.
side
Type "top" | "bottom"
"top"
Where the reason appears.
size
Type "sm" | "md" | "lg"
"md"
Height, padding and text size.
radius
Type number
12
Corner radius.
disabled
Type boolean
true
Blocks the action; a press explains why instead.
targetId
Type string
–
Id of the field to fix; it takes focus and flashes a ring.
onClick
Type () => void
–
Called on press while allowed.
onBlocked
Type () => void
–
Called on press while blocked.
type
Type "button" | "submit"
"button"
Button type while allowed.
className
Type string
–
Classes for the wrapper.