Skip to content

Button

Button uses Base UI behavior and Nesra’s light-mode styling.

import { Button } from "@nesra/ui/button";
export function SaveButton() {
return <Button>Save changes</Button>;
}

sm, md, and lg are 32, 40, and 44px tall. icon-* sizes are square. Default: md.

startIcon and endIcon are decorative. Icon-only buttons need an accessible name.

loading sets aria-busy and prevents activation. It hides the child of an icon-only button, so keep its aria-label.

  • Use an anchor for navigation. The link variant changes appearance, not button semantics.
  • Keep the keyboard focus state visible when extending styles.
Prop Type Default Description
variant "primary" | "outline" | "ghost" | "destructive" | "link" "primary" Visual style.
size "sm" | "md" | "lg" | "icon-sm" | "icon-md" | "icon-lg" "md" Height and padding; icon sizes are square.
children ReactNode Label or icon-only content.
startIcon ReactNode Decorative icon before the label.
endIcon ReactNode Decorative icon after the label.
loading boolean false Shows a loader, sets aria-busy, and prevents activation.
disabled boolean false Prevents interaction.
className string Adds or overrides classes.
type "button" | "submit" | "reset" "button" Native button behavior in forms.

Other Base UI Button props and native button attributes, such as onClick and aria-label, are forwarded. The Button’s visual values come from the semantic color roles and shape and elevation tokens.