Glin UI
Primitive / AtomAdapted from Vengeance UIbeta

Generate Button

AI style call to action with idle, generating and loading states.

Edit on GitHub

Product description

Draft copy for the Studio keyboard from its spec sheet. Press the button to start and again to stop.

75% layout, gasket mount, hot-swap switches, USB-C and Bluetooth, aluminum case in three finishes.
Uses 1 credit

Installation

Install from
pnpm dlx @glinui/cli@latest add generate-button

Credits. Adapted from Vengeance UI (MIT, (c) 2025-2026 Ashutoshx7). Scoped Tailwind instead of an injected style tag, token colors, explicit generating and loading states, live status text, glass and sizes. Attribution details.

Prefer the package?

Usage

Improvements: no injected style tag or font stack, scoped utilities on tokens, explicit generating and loading props instead of focus-driven state, aria-busy with a polite announcement, real disabled state, variant vocabulary (glinr default, glass opt-in), sizes and asChild.

Variants

The shining label follows the surface text colour on every variant.

<div className="flex flex-wrap items-center gap-3">
<GenerateButton variant="glinr" label="glinr" />
<GenerateButton variant="solid" label="solid" />
<GenerateButton variant="plain" label="plain" />
<GenerateButton variant="soft" label="soft" />
<GenerateButton variant="outline" label="outline" />
<GenerateButton variant="ghost" label="ghost" />
<GenerateButton variant="gradient" label="gradient" />
</div>

Glass (opt-in)

Glass is never the default. It needs a colorful or photographic backdrop to read.

Drafting
<GenerateButton variant="glass" defaultGenerating label="Draft reply" generatingLabel="Drafting" />

Hue, icon and loading

Custom hue and icon, plus the submitting state.

Deploying
<GenerateButton hue={150} leadingIcon={<Rocket weight="fill" />} label="Deploy" />
<GenerateButton loading />

Accessibility

  • Native button with the Button focus ring. Generating is never triggered by focus alone.
  • Only the visible label is in the accessibility tree, so the name is never doubled.
  • A polite status region announces the generating label.

Keyboard Interactions

KeyAction
EnterRequests the next state.
SpaceRequests the next state.

ARIA Attributes

  • `aria-busy` while generating or loading
  • `role=status` live region with the generating label
  • `data-generating` for styling hooks

Reduced Motion

Full motion sweeps a highlight across the label and pulses the sparkle. Subtle and none keep a static glow and the label swap only.

Affected properties

text sweepsparkle pulse

API Reference

GenerateButton

PropTypeRequiredDefaultDescription
variant"glinr" | "solid" | "plain" | "soft" | "outline" | "ghost" | "gradient" | "glass"-ambient (glinr)Surface from the shared vocabulary. Omit for the ambient default. Glass is opt-in and needs a backdrop.
tone"neutral" | "accent" | "success" | "warning" | "danger" | "info"-neutralColour axis.
size"xs" | "sm" | "md" | "lg" | "icon"NomdHeight and type size.
labelstringNoGenerateIdle label.
generatingLabelstringNoGeneratingLabel shown and announced while generating.
isGeneratingbooleanNo-Controlled generating state.
defaultGeneratingbooleanNofalseInitial state when uncontrolled.
onGeneratingChange(generating: boolean) => voidNo-Called with the requested next state on activation.
loadingbooleanNofalseSpinner, aria-busy and disabled. Separate from the generating glow.
huenumberNo250Highlight hue from 0 to 360.
leadingIconReact.ReactNodeNo-Replaces the sparkle.
trailingIconReact.ReactNodeNo-Decorative icon after the label.
asChildboolean-falseRender onto the single child element.
childrenReact.ReactElementNo-With `asChild`, pass the element to render, for example an anchor.

Source

Import directly from the package or browse the source on GitHub. Click any file to view it.

Import

import { GenerateButton } from "@glinui/ui"

Dependencies

@glinui/ui@glinui/motionclass-variance-authority@phosphor-icons/react

Generated API Snapshot

Beta

Auto-extracted from TypeScript source in packages/ui/src/components/generate-button.tsx. This section is in beta and may lag behind hand-curated docs. Regenerate with pnpm --filter @glinui/docs api:generate.

Generated: 2026-10-08T01:41:21.546Z · Full index: /docs/api-metadata

Primary Props Type

GenerateButtonProps

GenerateButtonProps

PropTypeRequiredDefaultDescription
childrenReact.ReactElementNo-With `asChild`, pass the element to render, for example an anchor.
defaultGeneratingbooleanNofalseInitial generating state when uncontrolled.
generatingLabelstringNo"Generating"Label shown (and announced) while generating.
huenumberNo-Highlight hue, 0 to 360. Defaults to a violet-blue.
isGeneratingbooleanNo-Controlled generating state.
labelstringNo"Generate"Idle label.
leadingIconReact.ReactNodeNo-Icon before the label. Defaults to a sparkle.
loadingbooleanNofalseSubmitting state: spinner, aria-busy and a disabled button (separate from the generating glow).
onGeneratingChange(generating: boolean) => voidNo-Called with the requested next state when the button is activated.
size"xs" | "sm" | "md" | "lg" | "icon"No"md"Variant option from generateButtonVariants.
trailingIconReact.ReactNodeNo-Icon after the label.