v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS
IconButton
An icon action with a required accessible name.
Interactive preview
Project not starred
Usage
import { IconButton } from "@devvy-ui/react";
<IconButton label="Star project" variant="outline"><svg viewBox="0 0 24 24" width="20" height="20"><path d="m12 3 3 6 7 1-5 5 1 7-6-3-6 3 1-7-5-5 7-1Z" fill="none" stroke="currentColor" /></svg></IconButton>API reference
Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | required | Accessible action name. |
| size / variant / tone / loading | Button props | Button defaults | Shared Button behavior. |
Accessibility & behavior
Platform Behavior & Guidelines
Built on Button, including native type, disabled/loading state, events and ref. The icon is decorative; use an action label and aria-pressed for toggles. Do not place interactive children inside the icon.
Source ownership
Run npx @devvy-ui/cli init once in your React project, then add the source:
npx @devvy-ui/cli add icon-buttonMake the source yours.
Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.
IconButton.tsxREACT / TSX
Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.