ZBMui

Button

View markdown

A button component that can be rendered as another tag or focusable when disabled.

Installation

components/ui/button.tsx

Usage

Cursor

Tailwind v4 switched from cursor: pointer to cursor: default for the button component. See reference

If you'd like to continue using cursor: pointer by default, add these base styles to your CSS:

globals.css

Examples

Variants

Sizes

Render as another tag

The button can remain keyboard accessible while being rendered as another tag, such as a <div>, by specifying nativeButton={false}

The Button component enforces button semantics. nativeButton={false} signals that the rendered tag is not a <button>, but it must still be a tag that can receive button semantics (role="button", keyboard interaction handlers).

Click me

The Base UI Button component always applies role="button", which overrides the semantic link role on <a> elements. Use buttonVariants with a plain <a> tag instead.

Loading state

For buttons that enter a loading state after being clicked, specify the focusableWhenDisabled prop to ensure focus remains on the button when it becomes disabled. This prevents focus from being lost and maintains the tab order.

API Reference

Button props

Component type props
Prop
Type
Default
Expand prop details

ZBMui

Built by the ZBM.

© 2026 ZBM ui. All rights reserved.