Skip to Content
glob.ui home
Components

Button

A button that can render as a link, and shows a loading state without changing its width.

Server componentNo state or handlers. Safe to render in a Server Component.
import { Button, buttonVariants } from "@glob-ui/button"

Preview

Examples

Variants

primary, secondary, outline and ghost. Use danger for destructive actions (delete, remove).

Sizes

sm, md (default) and lg.

States

disabled is not focusable. loading keeps the label width, sets aria-busy and disables the button.

asChild renders the single child (here an <a>) with the button styles and props.

API

Props are generated from the TypeScript types in the package source.

ButtonProps

Prop

Type

Accessibility

Key or actionBehaviour
Enter, SpaceActivates the button (native button behaviour).
TabMoves focus to the button. Disabled buttons are skipped.
loadingSets aria-busy="true" and disables the button, so it cannot be activated twice.
asChildSets aria-disabled instead of disabled, because a link has no disabled state.

ARIA. A text button needs a visible label, or an aria-label when it has only an icon. The spinner shown while loading does not change the accessible name.

On this page