Button
Flexible action button with solid, outlined, and link-style variants in multiple sizes. Use built-in variants for standard storefront actions, then layer semantic color props when campaign or editorial surfaces need stronger tone control.
Best for
Import
import { Button } from "@enadhq/enad-react-sdk/client/ui-resolver"When to use it
Use Button for primary actions, low-emphasis secondary actions, and inline text-like actions that still need the same spacing and state model as the rest of the SDK.
The safest default is to choose the closest built-in variant and size first. Reach for background, foreground, and border only when the surface already has a semantic token story and the built-in presets are too generic.
Composition notes
- Use
startSlotandendSlotfor icons and badges instead of manually padding children. - Use
asChildwhen the semantic element should be a link or another interactive root, but you still want the button recipe. - Keep destructive intent explicit with
variant="destructive"instead of only changing color tokens.
Theming guidance
The semantic color props are useful for storefront campaigns because they let a button inherit tone from the surrounding section without forking the recipe. That keeps hover, focus, spacing, and icon alignment consistent while still giving design room to art-direct a CTA.
For marketing-heavy pages, prefer passing theme tokens like var(--foreground) or var(--accent) instead of hard-coded hex values so the same authored example stays portable across presets and brands.
Examples
Live examples you can edit directly in the sandbox.
Basic button
The default solid button for primary page or form actions.
Variants
Compare the built-in weights before reaching for token overrides.
Bordered link button recipe
Use foreground plus border when the CTA should read like a lighter editorial link button instead of a full primary action.
Campaign CTA recipe
A token-driven CTA can keep the existing button recipe while picking up a stronger campaign-specific color treatment.
Component Sets
Preview the first example across the available component-set presets to compare tone, spacing, and structural defaults.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | string | — | No description yet. |
| size | string | — | No description yet. |
| background | string | — | No description yet. |
| foreground | string | — | No description yet. |
| border | string | — | No description yet. |
| asChild | boolean | — | No description yet. |
| startSlot | string | — | No description yet. |
| endSlot | string | — | No description yet. |