Shimmer Button
Call-to-action button with a slow band of light sweeping across it, with asChild support for links.
When to use
Use it for the single most important action on a page, such as "Get started" in a hero. The shimmer works because it is rare: one per screen, never for secondary actions.
Playground
Installation
pnpm dlx shadcn@latest add @cadence/shimmer-buttonRequires the @cadence namespace in components.json. See Installation.
Usage
import Link from "next/link"
import { ShimmerButton } from "@/components/ui/shimmer-button"
export function Hero() {
return (
<ShimmerButton asChild size="lg">
<Link href="/signup">Get started</Link>
</ShimmerButton>
)
}Use asChild to render a link (or any element) with the button styles. The brand variant uses
the --brand color, which the CLI adds to your theme; neutral uses your theme's primary.
Props
Prop
Type
Also accepts all props of ComponentProps<"button">.
Examples
Sizes, variants and links
Accessibility
- It is a native
<button>(or your own element withasChild), with a visible focus ring and the disabled state handled for you. - The shimmer is decorative and hidden from assistive technology.
- With reduced motion the shimmer is removed entirely.
Performance
- The sweep is a single
transformanimation run by the browser's compositor. - It stops while the button is off screen or the tab is hidden.