Components

Neon Button

A React button with a soft neon-tube glow, built on the DuskUI Button with Motion and Tailwind CSS. One glow layer brightens a little on hover and keyboard focus, can flicker on when it scrolls into view, and takes any CSS color. Loading states and every shadcn/ui Button prop keep working.

  • Any CSS color
  • Flicker-on effect
  • Loading state
  • Focus-visible glow
  • prefers-reduced-motion

Installation

$ npx shadcn@latest add https://duskui.com/r/neon-button.json

Builds on the DuskUI Button; the CLI installs it automatically. Installing by hand? Add components/ui/button.tsx from the Button page first.

Usage

hero-cta.tsx
import { NeonButton } from "@/components/dusk/neon/neon-button"

export function HeroCta() {
  return (
    <NeonButton size="lg" color="#f472b6" flicker>
      Get early access
    </NeonButton>
  )
}

Examples

Colors

Pass any CSS color to color — hex, oklch() or a theme variable. The border, text, glow and focus ring are all derived from it with color-mix().

Intensity & solid

intensity scales the glow; 0 turns it off. solid fills the tube for a higher-emphasis call to action.

Loading

loading and loadingText come straight from the base Button: the label crossfades to a spinner without changing the width, and the button stays focusable.

API Reference

Also accepts every DuskUI Button prop (size, loading, loadingText, loaderIcon) and Motion props such as whileTap. variant and asChild are not supported.

PropTypeDefaultDescription
colorstringvar(--color-primary)Any CSS color for the tube, text and glow.
intensitynumber1Glow strength multiplier. 0 removes the glow.
flickerbooleanfalseFlicker on like a neon tube the first time it scrolls into view.
solidbooleanfalseFilled tube with dark text instead of the outline style.
classNamestring—Merged with tailwind-merge, so overrides win.

Accessibility

  • Renders a native <button>, so Enter, Space and focus order work as usual.
  • Keyboard focus brightens the glow like hover does, plus a focus ring tinted to the neon color.
  • The glow layer is aria-hidden and absolutely positioned, so they never shift layout or reach screen readers.
  • The flicker-on effect has at most two soft dips per second (under the 3-flashes limit), only dims the glow, and is skipped entirely with prefers-reduced-motion.
  • Text is a light tint of the chosen color for strong contrast on dark backgrounds; check contrast if you place it on light surfaces.