A native button in DIYA's styles, or a link that looks like one with href or asChild; other button attributes pass through, and type defaults to 'button'. With aria-disabled (true or "true") it's unavailable but keeps focus, unlike disabled, with href and asChild too: it looks unavailable, and clicks, Enter and Space do nothing.
A Markdown brief for Claude, Cursor or v0: install, setup, props and a complete example.
For an action on this page: save, send, open a dialog. One solid button per area marks the main action; outline and quiet ones sit beside it.
Going to another page? Use Text Link, or a Button with href.
A native button, so Enter and Space work. An icon-only button needs an aria-label. Loading sets aria-busy and aria-disabled, keeps the label for screen readers, and keeps focus on the button while it ignores presses.
import { Button } from '@idyeah/diya'Stable since 1.0.0
asChildbooleanStyles your single child element as the Button instead of rendering one, such as a router Link; DIYA's classes, attributes and handlers merge into it.
Default false
downloadanyWith href, downloads the target instead of opening it; a string names the saved file.
hrefstringRenders a link to this URL that looks like a Button, through the provider's linkComponent (a plain anchor by default).
iconOnlybooleanSquare button for a single icon child; give it an aria-label, since the icon is its only content.
Default false
loadingbooleanShows a small spinner and sets aria-busy: after 400ms it takes the place of the leading icon, or else of the label, which keeps its width. If the label holds something with its own state, pass loading from the start (loading={false}); undefined counts as not passed. The button stays focusable, so focus isn't lost while it works, but it is inert: aria-disabled="true", and clicks, Enter and Space do nothing, so it can't submit twice.
Default false
relstringWith href, the link's relationship to this page, such as 'noopener'.
shape"pill" | "rounded"'pill' is fully round; 'rounded' uses the shared control corner, like fields. Defaults to 'pill'.
Default 'pill'
size"small" | "medium" | "large"Button height and text size. Defaults to 'medium'.
Default 'medium'
targetReact.HTMLAttributeAnchorTarget | undefinedWith href, where the link opens, such as '_blank'.
variant"solid" | "outline" | "quiet" | "destructive"'solid' for the main action, 'outline' for secondary ones, 'quiet' for low-emphasis ones, 'destructive' for an action that deletes or can't be undone. Defaults to 'solid'.
Default 'solid'
Also takes every native <button> attribute, such as name, id or data-*.