Skip to content

Early previewhamur is not on npm yet. The components are being built in the open, follow along on GitHub.

UIComponentsReact

Button

A button, or a link or trigger that looks like one.

Built on the headless Button.See its API in Docs

Rendered by React 19.3.1

button.tsx

Installation

npx shadcn@4.23.0 add https://hamur.dev/r/react/button.json

It also adds utils. The app needs its setup first: Installation.

Usage

Pick the look with variant (default, secondary, outline, ghost, destructive, link) and the height with size; the icon sizes make a square button for an icon alone. Every other prop goes to the headless Button, so disabled and focusableWhenDisabled behave as there.

To give another part the button's look, render the part as the Button: React and Solid pass it to render, Svelte to a render snippet, Vue as a render VNode, and Angular writes uiButton on the part's element.

import { Button } from '@/components/ui/button'

Examples

Default

The default and outline looks side by side.

Its preview and code are at the top of the page.

Variants

Each variant.

Rendered by React 19.3.1

button-variants.tsx

Sizes

xs, sm, the default and lg.

Rendered by React 19.3.1

button-sizes.tsx

API reference

The styled parts pass every prop to the headless part they wrap and add classes. The props, data attributes and keyboard are on Button's API reference.