Button

Interactive button primitive wrapped in React Aria Components.

The Button primitive is an unstyled, fully accessible interactive button component that supports keyboard navigation, screen reader accessibility, and hover/focus/press states.

Quick StartLink

Create a styled, accessible interactive button wrapper:

tsx
import { Button } from 'boltdocs/primitives'

export default function PrimaryButton() {
  return (
    <Button
      onPress={() => alert('Button Pressed!')}
      className="px-4 py-2 bg-primary-500 text-white rounded-lg hover:bg-primary-600 focus:outline-2 focus:outline-primary-500"
    >
      Click here
    </Button>
  )
}

Component PropsLink

The Button component accepts all React Aria ButtonProps plus common utility styles:

PropertyTypeDefaultDescription
onPress(e: PressEvent) => voidundefinedCallback fired when the button is pressed (via click, touch, or keyboard space/enter).
isDisabledbooleanfalseDisables the button, preventing interactions and setting aria-disabled="true".
type'button' | 'submit' | 'reset''button'The type of the HTML button element.
classNamestringundefinedCustom utility CSS class overrides.
styleCSSPropertiesundefinedInline style overrides.
childrenReactNodeundefinedThe label text or graphic elements to render inside the button.

Customization & statesLink

Button is style-neutral: the primitive ships the structure, the behavior, and the interaction handling, and every visual decision (colors, borders, radius, sizes) belongs to the theme. Because it is a raw RAC.Button, the interaction state is exposed two ways — through the className render function and through data-* attributes that RAC mirrors onto the element — so pressed, hover, and focus styles come from CSS in your theme.

State / SlotMechanism
className (render function)Receives { isHovered, isPressed, isFocused, isFocusVisible, isDisabled } for conditional styling
data-hoveredPresent on the button while the pointer hovers it
data-pressedPresent while the button is being pressed (mouse, touch, or keyboard)
data-focused / data-focus-visiblePresent while focused; data-focus-visible only for keyboard focus
data-disabledPresent when isDisabled is set
isDisabled / aria-disabledDisables interaction; data-disabled and aria-disabled are set for you

Tailwind v4:

tsx
<Button
  className="px-4 py-2 rounded-lg text-white bg-primary-500 transition-colors
             hover:bg-primary-600 data-pressed:bg-primary-700
             data-focus-visible:outline-2 data-focus-visible:outline-primary-500"
>
  Click here
</Button>
Last updated on October 18, 2026

Was this page helpful?