Skip to content

Button

Interactive button, or an anchor styled as one when href is set.

For size="icon" (no visible text), pass aria-label on the element — it’s forwarded to the inner control since the host itself is never left focusable/labelled (an explicit role/tabindex on the host is moved to the inner button/anchor on load, so there’s only one interactive surface for assistive tech to land on).

Default Destructive Outline Secondary Ghost Link
<and-button variant="default">Default</and-button>
<and-button variant="destructive">Destructive</and-button>
<and-button variant="outline">Outline</and-button>
<and-button variant="secondary">Secondary</and-button>
<and-button variant="ghost">Ghost</and-button>
<and-button variant="link">Link</and-button>
PropertyAttributeDescriptionTypeDefault
customClassclassAdditional CSS classes to merge with the internal styles.string''
disableddisabledDisables the button when true.booleanfalse
hrefhrefWhen set, renders as an anchor (<a>) instead of <button>.string''
loadingloadingShows a loading spinner and disables interaction.booleanfalse
relrelRel attribute for the anchor. Defaults to noopener noreferrer when target is _blank.string''
sizesizeSize of the button."default" | "icon" | "lg" | "sm"'default'
targettargetTarget for the anchor (e.g. _blank). Only used when href is set.string''
typetypeHTML button type attribute."button" | "reset" | "submit"'button'
variantvariantVisual variant of the button."default" | "destructive" | "ghost" | "link" | "outline" | "secondary"'default'
EventDescriptionType
andButtonClickEmitted on button click.CustomEvent<MouseEvent>
Generated from `packages/web-components/src/components/and-button/readme.md` — keep this table in sync with the Stencil source, don't hand-edit the numbers.