Gradient Button

A gradient-bordered call-to-action button from the KokonutUI registry that wraps the shadcn Button in a ghost variant and layers themed color washes, an inset glow, and a hover sheen behind its label. It ships three color themes (emerald, purple, orange) with separate light and dark mode treatments.

Gradient Button
LIVE · running in a sandboxed iframe
Installed with plain shadcn add · no workarounds · theme neutral (none shipped)
See how it was built

Installation

pnpm dlx shadcn@latest add @kokonutui/gradient-button

Requires @kokonutui in the registries of your components.json (shadcn adds official directory namespaces automatically).

Usage

usage.tsx
import GradientButton from "@/components/kokonutui/gradient-button";export default function Example() {  return <GradientButton variant="purple" label="Get started" />;}
  • Primary call-to-action on landing pages or hero sections where a glossy, colorful button is wanted.
  • Highlighting a single important action in a dashboard or onboarding flow using a themed accent color.
  • Replacing a plain default button when a branded emerald, purple, or orange accent should carry through light and dark mode.
  • Pairing a leading icon with a short label for feature buttons that need visual emphasis.

Examples

Default emerald button

Renders the default emerald theme using the label prop as text.

default-emerald-button.tsx
import GradientButton from "@/components/kokonutui/gradient-button";export default function DefaultExample() {  return <GradientButton label="Welcome" />;}

Orange button with icon

Adds a leading lucide-react icon rendered in the theme's icon color.

orange-button-with-icon.tsx
import { Rocket } from "lucide-react";import GradientButton from "@/components/kokonutui/gradient-button";export default function IconExample() {  return (    <GradientButton      variant="orange"      icon={<Rocket className="size-5" />}      label="Launch"    />  );}

Custom children with click handler

Children take precedence over label; a plain string child still gets the gradient text treatment.

custom-children-with-click-handler.tsx
import GradientButton from "@/components/kokonutui/gradient-button";export default function ChildrenExample() {  return (    <GradientButton variant="purple" onClick={() => console.log("clicked")}>      Subscribe    </GradientButton>  );}

Full width with rounded-full shape

Overrides layout and radius through className, which is merged after internal classes.

full-width-with-rounded-full-shape.tsx
import GradientButton from "@/components/kokonutui/gradient-button";export default function WideExample() {  return (    <GradientButton      variant="emerald"      label="Start free trial"      className="w-full rounded-full"    />  );}

API reference

PropTypeDefaultDescription
childrenReactNode—Button content. Takes precedence over label. Plain strings and numbers receive the gradient text style; other nodes are rendered as-is.
labelstring"Welcome"Fallback text used when no children are passed.
iconReactNode—Optional icon rendered before the text, colored by the active variant.
variant"emerald" | "purple" | "orange""emerald"Color theme controlling the border, washes, glow, text gradient, and focus ring colors.
classNamestring—Additional classes merged into the button root via cn(); can override size, radius, and width.
...propsOmit<ComponentProps<"button">, "children">—All other native button attributes (onClick, disabled, type, aria-*, etc.) are forwarded to the underlying Button.

Accessibility

  • Decorative layers are marked aria-hidden="true", so screen readers announce only the label and icon text.
  • The icon wrapper is aria-hidden; provide meaningful text in label or children, or add aria-label on the button for icon-only use.
  • Focus is shown with a themed focus-visible ring (color varies by variant), keeping keyboard focus visible.
  • Press scale and hover sheen animations are disabled under prefers-reduced-motion via motion-reduce classes.
  • Gradient text uses bg-clip-text, which is transparent; ensure sufficient contrast of the emerald, purple, or orange text against the surface in both themes.
  • The hover sheen only activates on hover-capable devices because Tailwind v4 gates hover styles to (hover: hover).

Docs written by anthropic:claude-haiku-5-5 from the registry source.

Use with Coding Agent

Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.

prompt.md
Use the "Gradient Button" component (kokonutui/gradient-button) from its shadcn registry.1. Install it with: npx shadcn@latest add @kokonutui/gradient-button2. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: children, label, icon, variant, className, ...props.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport GradientButton from "@/components/kokonutui/gradient-button";export default function Example() {  return <GradientButton variant="purple" label="Get started" />;}```

Files & dependencies

  • /components/kokonutui/gradient-button.tsx→ components/kokonutui/gradient-button.tsx
registryDependenciesbutton

Looks similar, elsewhere