GitHub

Button

A styled button with full htmx integration, ARIA support, and multiple visual variants.

<rhx-button>

Examples

Variants

Appearances

Sizes

States

Shapes

Link Buttons

htmx Integration

Click a button...

Properties

Property Type Default Description
rhx-variant string neutral Color variant: neutral, brand, success, warning, danger
rhx-appearance string filled Visual style: filled, outlined, plain
rhx-size string medium Button size: small, medium, large
rhx-disabled bool false Whether the button is disabled
rhx-loading bool false Shows a spinner and disables interaction
rhx-pill bool false Renders with fully rounded corners
rhx-circle bool false Renders as a circle for icon-only buttons
rhx-href string - When set, renders as an <a> tag with this URL
rhx-target string - Link target (e.g. _blank). Only with rhx-href
rhx-download string - Download filename. Only with rhx-href
type string button HTML button type: button, submit, reset
name string - Form submission name
value string - Form submission value
aria-label string - Accessible label for icon-only buttons

Accessibility

  • Renders a native <button> element with full keyboard support.
  • Use aria-label for icon-only or circle buttons that lack visible text.
  • Loading state sets aria-busy="true" and disables interaction.
  • Link buttons (rhx-href) render as <a> with role="button" and aria-disabled when disabled.
  • External links automatically get rel="noopener noreferrer".