Action button for primary, secondary, inline, loading, and routed interactions.
npx shadcn@latest add @iconiq/b-buttonimport { Button } from "@/components/ui/b-button";
export function ButtonPreview() {
return (
<p className="flex flex-wrap items-center justify-center gap-x-2 gap-y-2 text-balance font-medium text-lg text-neutral-800 leading-snug tracking-tight sm:text-xl dark:text-neutral-100">
<span>When you are ready to ship with</span>
<span className="font-medium text-foreground">default</span>
<span>tap</span>
<span className="inline-flex translate-y-px align-middle">
<Button variant="default">Continue</Button>
</span>
<span>to finish.</span>
</p>
);
}variantChooses the visual recipe from the exported buttonVariants map.
Type "default" | "destructive" | "outline" | "secondary" | "ghost" | "link"·Default default
linkUnderlineLink variant only. motion keeps foreground text with a grey baseline underline that fills darker on hover. static uses the same text size as other variants with hover:underline.
Type "motion" | "static"·Default "motion" (when variant is link)
sizeControls the shadcn-style height, padding, gap, radius, and icon sizing for text and icon-only buttons.
Type "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg"·Default default
animateSizeAnimates the button width with a spring as its intrinsic content changes, which is useful for labels like Continue, Saving..., and Saved on the same control.
Type boolean·Default false
loadingLocks the control, sets aria-busy, crossfades the label and icon into a spring-animated spinner, and suppresses ripples until loading finishes.
Type boolean·Default false
loadingIconOptional spinner or status icon shown while loading is true. Defaults to a Lucide Loader2 icon with animate-spin.
Type ReactNode
hrefWhen set, renders an animated anchor instead of a button. Disabled and loading states use aria-disabled, tabIndex -1, and click prevention.
Type string
targetAnchor target such as "_blank". When the target opens a new tab, rel automatically gains noopener and noreferrer unless you already supplied them.
Type string
relOptional anchor rel attribute. Merged with noopener noreferrer when target includes _blank.
Type string
disableRippleSkips the pointer ripple when you want only the press-state feedback. Link buttons also skip the ripple by default to avoid a contained splash on text-only actions.
Type boolean·Default false
typePassed to the underlying button element so the component does not submit forms accidentally by default. Ignored for href links.
Type "button" | "submit" | "reset"·Default button
childrenLabel content rendered above the ripple layer inside a z-10 span.
Type ReactNode
iconOptional icon rendered inline with the label. Nested SVGs inherit the built-in size utility and variant-aware icon color.
Type ReactNode
iconLabelConvenience prop that sets aria-label, which is required for icon-only sizes when no visible text children are present.
Type string
iconPositionChooses whether the optional icon renders before or after the button text inside the same inline content row. Loading always renders at the start.
Type "start" | "end"·Default "start"
classNameMerged after the generated CVA classes, making it the main escape hatch for one-off layout changes.
Type string
disabledNative disabled state. Combines with loading to lock interaction and prevent ripple creation.
Type boolean
variantVisual recipe passed to the CVA helper when composing classes outside the Button component.
Type "default" | "destructive" | "outline" | "secondary" | "ghost" | "link"·Default "default"
linkUnderlineLink variant only. Pass through the same underline mode used by the Button component.
Type "motion" | "static"·Default "motion" (when variant is link)
sizeSize token passed to the CVA helper for text and icon-only button recipes.
Type "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg"·Default "default"
classNameOptional classes merged after the generated variant and size classes.
Type string
Install the exact registry entry shown on the right when you want the component file and its declared runtime dependencies together.
Dependencies: @base-ui/react, motion, class-variance-authority, lucide-react.
Embedded Iconiq theme tokens ship inside the component, so colors resolve without a separate theme install.
This page documents the Base UI install only, because Radix UI does not ship a separate button primitive.
The generated registry file is /r/b-button.json.
Contact
Additionally, if you find any bug or issue, feel free to raise an issue.
When you are ready to ship withdefaulttapto finish.