Button
Explore the Button component and try its interactive examples.
Preview
When to use
Use Button to trigger an action or submit a form. Use ButtonLink when the action navigates to another page.
Installation
Install the component source via shadcn Registry, the BIU CLI, or as an npm package.
First time using @biudev? Map "@biudev": "https://ui.biu.dev/r/0.1.0/{name}.json" under registries in your components.json (see setup).
Usage
Start with this example, then adjust the import path for your project.
Examples
Try each example or switch to its code.
API reference
Properties and defaults from the component source. An asterisk marks a required property; a dash means no explicit default.
ButtonProps
Also accepts properties from ComponentPropsWithRef<'button'>.
ButtonLinkProps
Also accepts properties from ComponentPropsWithRef<'a'>.
Keyboard and accessibility
Button uses a native button, which can be reached with Tab and activated with Enter or Space. For icon-only buttons, provide an accessible name. Loading sets aria-busy and suppresses clicks; disabled uses the native disabled state.
Source
Review a formatted version of the component source used by the Registry.