Skip to content

Button

Navigation

Primary action trigger with variants: default, destructive, outline, secondary, ghost, link. Multiple sizes available.

Six visual variantsEight sizesDisabled and loadingInteractive action
Open preview

Responsive viewport — resize the window to explore. Direction and density apply only to this preview. Theme applies to the docs too.

Usage

Use a button for an action and an anchor for navigation. Use asChild to style a single link child. Add a loading icon and disable the action while a write is pending.

Import
import { Button } from "@dashboardpack/core/components/ui/button";

Available in the included @dashboardpack/core package. Copy the complete example from Source code for all imports and state. Add "use client" when using hooks or event handlers. See installation and theming for project setup.

API reference

Common props and defaults. Slot-specific props are named below; native elements also accept their standard HTML attributes. The component TypeScript definitions are the complete type reference.

Button props
PropType / DefaultDescription
variantdefault | destructive | outline | secondary | ghost | link

Default: default

Visual treatment for the action.
sizedefault | xs | sm | lg | icon | icon-xs | icon-sm | icon-lg

Default: default

Control size, including square icon buttons.
asChildboolean

Default: false

Apply button styling to a single child element.
disabledboolean

Default: false

Prevent interaction while unavailable.

Build with these too