components / button

button.

polymorphic button with five variants, optional icons, hover tooltip, and click-to-clipboard. renders as an anchor when given href.

installation
bunx @justin06lee/chrome@latest add button
props
nametypedefaultdescription
variant'solid' | 'outline' | 'dashed' | 'ghost' | 'link''outline'
size'sm' | 'md''md'
iconLucideIcon-lucide icon before text (or alone if no children).
iconRightLucideIcon-lucide icon after text.
tooltipstring-white slide-up pill shown on hover.
labelstring-aria-label override; required for icon-only buttons.
hrefstring-renders as <a>. external URLs (http(s)://) get target="_blank" auto-applied.
linkComponentReact.ElementType-anchor component for internal hrefs — pass your router's Link (e.g. next/link) for client-side navigation + prefetch. external http(s) hrefs always use a plain <a>.
prefetchboolean-forwarded to linkComponent (e.g. next/link's prefetch) when set.
onClick() => void-
fullWidthbooleanfalse
disabledbooleanfalse
copystring-click copies this to the clipboard. tooltip + text children swap to copyFeedback for 1.5s.
copyFeedbackstring'Copied!'
backgroundstring-CSS background applied to the root element. transparent by default.