Black Friday: 30% off Pro

Get 30% off

Updated

Expand Button

Preview

Customize

Blur
Soft
None
Gap6px
Size40px
Radius12px

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.

Usage

import { ExpandButton } from "@/components/uibrik/expand-button/expand-button";​<ExpandButton  icon={<IconPlus size={20} />}  label="New file"  reveal="blur"  variant="soft"  size={40}  radius={12}  expanded={false}  onClick={(event) => {}}/>

Where to use Expand Button

  • Compact toolbars

    Icon buttons reveal their label on hover or focus, so toolbars stay small but clear.

    Pairs with Fold Toolbar

  • Floating actions

    A label that springs open explains what a floating button does before it is pressed.

  • Mobile headers

    Icon-only buttons save space while focus still shows the label for accessibility.

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.