Button triggers user actions such as submit, confirm, cancel, or state toggles.
A standard button that responds to click and keyboard activation (Enter/Space).
<Button onClick={() => alert('Clicked')}>
Click me
</Button>Disabled buttons cannot be activated. Screen readers announce the disabled state. Focus should skip the disabled button when tabbing.
<Button disabled>
Disabled button
</Button>Loading button uses aria-busy="true" and aria-live="polite" to announce loading state to screen readers.
<Button isLoading={isLoading} onClick={simulateLoading}>
{isLoading ? 'Saving…' : 'Save changes'}
</Button>Controlled toggle where parent manages the pressed state.
const [isPressed, setIsPressed] = useState(false);
<Button isPressed={isPressed} onPressedChange={(pressed) => setIsPressed(pressed)}>
{isPressed ? 'Notifications On' : 'Notifications Off'}
</Button>Button can render as different HTML elements. When rendered as non-button elements, it adds role="button", tabIndex, and keyboard handlers.
<Button>Native button</Button>
<Button as='a' href='#polymorphic-link'>
Rendered as a
</Button>
<Button as='span'>Rendered as span</Button>This button receives focus automatically on mount. Useful for modal dialogs or important CTAs.
<Button autoFocus>
I should be focused on page load
</Button>