Ballmac UI home

Rainbow Button

A button with a border of theme colors circling it and a glow on hover, built on the Ballmac button so every size, variant and focus state still works.

Installation

$ pnpm dlx shadcn@latest add @ballmac/rainbow-button

Usage

import { RainbowButton } from "@/components/ballmac/rainbow-button"

The full example is in the Code tab above.

Examples

Sizes and pill

API reference

PropTypeDefault
duration

Seconds for the colors to travel once around the border.

number4
glow

Show a soft glow of the same colors under the button.

booleantrue
wrapperClassName

Classes for the wrapper that draws the border.

string—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Enter / SpaceActivates like any button
FocusThe standard focus ring and the glow both appear on keyboard focus
Reduced motionThe border is a still gradient

Use with AI

Use like <Button>: <RainbowButton size variant shape duration glow>Label</RainbowButton>. Best with default, secondary or outline variants (the inside needs a background). With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Rainbow Button (@ballmac/rainbow-button) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • The single most important call to action on a page
  • Upgrade and launch prompts

Not for

  • Several buttons on one screen
  • Ghost buttons (no background to sit on the border)

Registry JSON: https://ui.ballmac.com/r/rainbow-button.json

Credits

Free to use in personal and commercial projects.