Skip to content

ActionsLumen Halo

Clipboard ButtonFreev1.0.0

Copies text and says so: the copy icon becomes a check that draws itself in, the label reads Copied, and screen readers hear it. Falls back when the clipboard is blocked, and the value can be made on press, even asynchronously.

Built on shadcn/ui

.md
Base UIpnpm dlx shadcn@latest add https://beautiful-ui.dev/r/lumen-clipboard-button.json
Radixpnpm dlx shadcn@latest add https://beautiful-ui.dev/r/radix-nova/lumen-clipboard-button.json

Free, no account or key. Use the command for your project's primitives: a radix-*, new-york or default style in components.json is Radix, a base-* style is Base UI. With the @beautiful-ui registry added, @beautiful-ui/<name> picks for you.

Set up the Beautiful UI registry

Free pieces install from their URL with no setup (that URL gives the Base UI build; Radix projects use /r/radix-nova/<name>.json, or add the registries below and the CLI picks your build). Pro pieces need the registries below and BEAUTIFUL_UI_TOKEN in .env.local.

components.json
{
  "registries": {
    "@beautiful-ui": "https://beautiful-ui.dev/r/{style}/{name}.json",
    "@beautiful-ui-pro": {
      "url": "https://beautiful-ui.dev/r/pro/{style}/{name}.json",
      "headers": { "Authorization": "Bearer ${BEAUTIFUL_UI_TOKEN}" }
    }
  }
}

MCP server

claude mcp add --transport http beautiful-ui https://beautiful-ui.dev/api/mcp
Catalog for agents: /llms.txt
Icon only

Usage

Import it and pass your content. The props that matter most are listed next.

Example
import { ClipboardButton } from "@/components/ui/lumen/controls/clipboard-button";

<ClipboardButton value={apiKey}>Copy key</ClipboardButton>
<ClipboardButton value={inviteUrl} aria-label="Copy invite link" />

Props

  • motion"full"

    "full" | "subtle" | "off"

    As on Button: subtle is shorter on a calm curve; off is instant. Reduced motion is respected automatically.

  • value–

    string | (() => string | Promise<string>)

    The text, or a function that makes it on press.

  • children–

    ReactNode

    The label. Without it the button is icon-only: give it an aria-label.

  • copiedLabel / errorLabel"Copied" / "Couldn't copy"

    string

    Shown and announced after a press.

  • resetMs1800

    number

    How long the result shows.

  • onCopy–

    (text: string) => void

    Called once the text is on the clipboard.

Show all 7 props
  • variant / size"secondary" / "default"

    Button props

    As on Button.

Source

components/ui/lumen/controls/clipboard-button.tsx