HighlightButton

A button with a cursor spotlight, a border that lights up near the pointer, and a ripple from wherever you click.

Preview

Props

Install

npx shadcn@latest add @evilbuttons/highlight-button

Usage

import { HighlightButton } from "@/components/evil-buttons/highlight-button";

export function ButtonDemo() {
  return <HighlightButton variant="outline">Click Me</HighlightButton>;
}

Variants

Custom colors

Any CSS color works for the spotlight and the border.

Props

The component spreads native button props and forwards its ref to the button.

PropTypeDefaultDescription
childrenReact.ReactNode-The button label or content.
variant"default" | "secondary" | "outline""default"Surface style of the button.
highlightColorstring"color-mix(in oklab, currentColor 28%, transparent)"Color of the cursor spotlight and click ripple.
highlightSizenumber90Radius in px of the cursor spotlight.
borderColorstring"color-mix(in oklab, currentColor 75%, transparent)"Color the border lights up with near the cursor.
classNamestring-Extra classes passed to the button.

Good to know

  • Pointer moves never re-render the component.
  • The lit border follows the button's radius.

Search docs

Jump to a button documentation page