Glow buttons
Five takes on colored light: a hover halo, a pulsing glow, an always-on aura, a neon outline and a flickering ember. Each is sized and token-driven.
Installation
The styled layer is free and installs like any other ai2 component.
Run the following command
npx shadcn@latest add @ai2/buttons-glowDependencies, the @ai2/tokens theme and the component file are installed together.
Install dependencies
npm install motionCopy the source
components/ui/buttons-glow.tsx"use client"
import * as React from "react"
import { motion, useReducedMotion, type HTMLMotionProps } from "motion/react"
import { cn } from "@/lib/utils"
/* Glow button family: 5 variations on coloured halos and light. All are sized (aligned with the base scale), use framer-motion, take colour ONLY from semantic tokens and are reduced-motion safe. The glows derive from a token-coloured box-shadow or a blurred sibling layer. */
export type StyledSize = "sm" | "md" | "lg" | "xl"
const sizes: Record<StyledSize, string> = {
sm: "h-8 gap-1.5 rounded-md px-3 text-sm",
md: "h-9 gap-2 rounded-lg px-4 text-sm",
lg: "h-10 gap-2 rounded-lg px-5 text-sm",
xl: "h-12 gap-2.5 rounded-xl px-6 text-base",
}
const base =
"relative inline-flex shrink-0 select-none items-center justify-center font-medium whitespace-nowrap outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_i]:text-base [&_i]:leading-none"
type Props = HTMLMotionProps<"button"> & { size?: StyledSize }
/* Glow: a token-coloured halo (box-shadow) appears on hover. */
export function GlowButton({ className, size = "md", children, ...props }: Props) {
const reduce = useReducedMotion()
return (
<motion.button
data-slot="styled-button"
whileHover={reduce ? undefined : { scale: 1.03 }}
whileTap={reduce ? undefined : { scale: 0.97 }}
transition={{ type: "spring", stiffness: 350, damping: 22 }}
className={cn(
base,
sizes[size],
"bg-info text-info-foreground transition-shadow duration-(--motion-base) hover:shadow-[0_6px_30px_-4px_var(--info)]",
className
)}
{...props}
>
{children}
</motion.button>
)
}
/* Pulse: arkadaki blur'lu token katman surekli nabiz gibi buyuyup soner. */
export function PulseGlowButton({ className, size = "md", children, ...props }: Props) {
const reduce = useReducedMotion()
return (
<span className="relative inline-flex">
<motion.span
aria-hidden="true"
className="pointer-events-none absolute inset-0 rounded-lg bg-info blur-md"
animate={reduce ? undefined : { opacity: [0.35, 0.7, 0.35], scale: [1, 1.08, 1] }}
transition={reduce ? undefined : { duration: 2, ease: "easeInOut", repeat: Infinity }}
/>
<motion.button
data-slot="styled-button"
whileTap={reduce ? undefined : { scale: 0.97 }}
transition={{ type: "spring", stiffness: 350, damping: 22 }}
className={cn(base, sizes[size], "bg-info text-info-foreground", className)}
{...props}
>
{children}
</motion.button>
</span>
)
}
/* Aura: a soft halo is always present and intensifies on hover. */
export function AuraButton({ className, size = "md", children, ...props }: Props) {
const reduce = useReducedMotion()
return (
<span className="group relative inline-flex">
<span
aria-hidden="true"
className="pointer-events-none absolute inset-0 rounded-lg bg-brand opacity-40 blur-xl transition-opacity duration-(--motion-slow) group-hover:opacity-70"
/>
<motion.button
data-slot="styled-button"
whileHover={reduce ? undefined : { scale: 1.03 }}
whileTap={reduce ? undefined : { scale: 0.97 }}
transition={{ type: "spring", stiffness: 350, damping: 22 }}
className={cn(base, sizes[size], "bg-brand text-brand-foreground", className)}
{...props}
>
{children}
</motion.button>
</span>
)
}
/* Neon: a bright token line plus inner and outer glow, transparent body. */
export function NeonButton({ className, size = "md", children, ...props }: Props) {
const reduce = useReducedMotion()
return (
<motion.button
data-slot="styled-button"
whileHover={reduce ? undefined : { scale: 1.03 }}
whileTap={reduce ? undefined : { scale: 0.97 }}
transition={{ type: "spring", stiffness: 350, damping: 22 }}
className={cn(
base,
sizes[size],
"border border-info bg-transparent text-info shadow-[0_0_12px_-2px_var(--info),inset_0_0_8px_-4px_var(--info)] transition-shadow duration-(--motion-base) hover:shadow-[0_0_22px_-2px_var(--info),inset_0_0_12px_-4px_var(--info)]",
className
)}
{...props}
>
{children}
</motion.button>
)
}
/* Ember: a lightly flickering ember light over a warm token (warning). */
export function EmberButton({ className, size = "md", children, ...props }: Props) {
const reduce = useReducedMotion()
return (
<span className="relative inline-flex">
<motion.span
aria-hidden="true"
className="pointer-events-none absolute inset-0 rounded-lg bg-warning blur-md"
animate={reduce ? undefined : { opacity: [0.5, 0.8, 0.55, 0.75, 0.5] }}
transition={reduce ? undefined : { duration: 1.6, ease: "easeInOut", repeat: Infinity }}
/>
<motion.button
data-slot="styled-button"
whileTap={reduce ? undefined : { scale: 0.97 }}
transition={{ type: "spring", stiffness: 350, damping: 22 }}
className={cn(base, sizes[size], "bg-warning text-warning-foreground", className)}
{...props}
>
{children}
</motion.button>
</span>
)
}Manual installs skip the @ai2/tokens theme, so add the token CSS from the theming guide or the tone colors will be missing.
Variations
5 takes on the same idea. Each is its own export, and every one accepts a size prop (sm, md, lg, xl) aligned to the base Button scale.
Glow
A soft token-colored halo blooms on hover.
import { GlowButton } from "@/components/ui/buttons-glow"
<GlowButton>Glow</GlowButton>Pulse
A halo pulses continuously behind the button.
import { PulseGlowButton } from "@/components/ui/buttons-glow"
<PulseGlowButton>Pulse</PulseGlowButton>Aura
A soft aura is always present and intensifies on hover.
import { AuraButton } from "@/components/ui/buttons-glow"
<AuraButton>Aura</AuraButton>Neon
A bright token outline with inner and outer glow on a clear body.
import { NeonButton } from "@/components/ui/buttons-glow"
<NeonButton>Neon</NeonButton>Ember
A warm token glow flickers gently like a coal.
import { EmberButton } from "@/components/ui/buttons-glow"
<EmberButton>Ember</EmberButton>ai2 Glow buttons: 5 styled variations on the token system
The ai2 Glow buttons are a set of 5 decorative button variations from the styled layer of the @ai2 design system, built around colored light and halos. They are free and MIT licensed, and every color comes from a semantic token, so they theme with the rest of ai2 in light and dark.
Motion runs on framer-motion: framer-motion drives the hover spring, the pulsing halo and the flickering ember. The styled layer is opt-in, so the dependency only lands if you use it; the base components stay lean. Under reduced motion, the pulses and flicker stop and only static glows remain.
What is in the ai2 Glow buttons?
5 exports in one file: Glow, Pulse, Aura, Neon and Ember. Each renders a native button and takes a size prop (sm, md, lg, xl) aligned to the base Button. They are separate from the base Button on purpose: the base keeps its clean variant, tone and size axes, while the styled layer carries the effects.
You own the file. Copy the one category file and you have all 5 variations, with no runtime dependency on ai2 itself.
Why use it
- On-system by construction: Every color resolves to an ai2 semantic token, so the buttons follow your theme in light and dark with no extra work.
- Effect without the sprawl: The decorations live in a dedicated styled file, so the base Button keeps its clean, predictable API.
- Accessible and honest: Each renders a real button element, keeps a visible focus ring, and respects prefers-reduced-motion.
Features
- Token-driven color: No hardcoded hex or oklch; the look recolors with your theme tokens.
- framer-motion: framer-motion drives the hover spring, the pulsing halo and the flickering ember.
- Reduced-motion aware: Under prefers-reduced-motion, the pulses and flicker stop and only static glows remain.
- Size aligned to the base: Every variation takes sm, md, lg and xl matching the base Button height scale, so styled and base buttons line up in a row.
Production tips
- Use it for emphasis, not everywhere: Styled buttons draw the eye. Reserve them for the one action you want people to take on a screen, and use the base Button for the rest.
- Keep labels as verbs: The decoration adds weight, so a clear action label keeps the button scannable.
- Pick one variation per surface: The variations share a family; using two different ones in the same view competes for attention.
Works with the rest of ai2
The Glow buttons sit alongside the base Button and the rest of the @ai2 registry. They share the same token file, so a styled action next to a base button or a badge stays visually consistent in both modes.