uibrik

Expand Button

Preview

Customize

Blur
Soft
None
Gap6px
Size40px
Radius12px

Usage

import { ExpandButton } from "@/components/uibrik/expand-button/expand-button";

<ExpandButton icon={icon} label={label} />

Installation

npx shadcn@latest add https://uibrik.com/r/expand-button.json
Adds the files to components/uibrik/expand-button and installs motion and react-use-measure. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/expand-button.

Props

ExpandButton
reveal
Type "blur" | "slide" | "fade"
"blur"
How the label appears as the button opens.
variant
Type "soft" | "ghost" | "outline"
"soft"
Tinted, transparent until open, or outlined.
size
Type number
40
Height, and resting width.
radius
Type number
12
Corner radius.
iconrequired
Type ReactNode
–
Shown at rest.
labelrequired
Type string
–
Revealed on hover or keyboard focus. Also the accessible name.
expanded
Type boolean
false
Keep the label showing, e.g. for the active item.
onClick
Type MouseEventHandler<HTMLButtonElement>
–
Called on click, like any button.
className
Type string
–
Classes for the button.