Sizes
The default size is medium.
Shapes
Icon-only buttons should include the svgOnly prop and an aria-label.
Rounded
Combination of shape="rounded" and the shadow prop, often used on marketing pages.
Link
Use ButtonLink for links with the same props as Button.
Custom
Use CustomButton to override colors for foreground, background, and border across normal, hover, and active states.
Best Practices
- Use
Buttonfor actions that mutate state (deploy, save, delete); useButtonLinkfor navigation that changes the URL. Switch to a Menu or Split Button when more than one related action shares a row. - Default
Buttonis primary. Passtype="secondary"for the supporting action andtype="error"for destructive confirmations.primary,success,ghost, andvioletare not validtypevalues. - For form submits, use
typeName="submit". The HTMLtypeattribute lives ontypeName, not ontype, which controls the visual variant. - Pass
loadinginstead of swapping in a spinner so the button stays focusable and announces the busy state to assistive tech. - Disable a button only when the action is impossible right now (missing input, insufficient permission); pair with a Tooltip that explains why.
- Title Case the label and name what happens:
Deploy Project,Invite Member,Rotate Key. Avoid bare verbs (Submit) and generic confirms (OK,Confirm). - Destructive buttons follow
Verb + Nounand pair 1:1 with their toast:Delete ProjectthenProject deleted. Mode-switch buttons appendInstead:Use a Recovery Code Instead. - Icon-only buttons require both
svgOnlyandaria-label; the validator throws without them. Thearia-labelnames the action and the target (Copy deployment URL), not the icon (Copy). - Don’t set
aria-labelon a button that already has visible text; it overrides the label and creates a screen-reader mismatch.