OPEN-UI

Snippet

One-line code or command display with copy button. Compound component: Provider, Input, Addon, Text, CopyButton. Use for install commands, tokens, or copyable snippets.

$

Install

Use Open-UI CLI or Shadcn CLI to install the component.

Open-UI CLI

Shadcn CLI

Usage

ItemPropDefaultDescriptionType
ProvidercodeText to display and copy.string
ProviderclassNameAdditional CSS class for the root container.string
Addonaligninline-startAlignment of the addon (inline/block, start/end)."inline-start" | "inline-end" | "block-start" | "block-end"
CopyButtononCopyCalled after the code is copied successfully.() => void
CopyButtononErrorCalled when copying fails (e.g. Clipboard API unavailable).(error: Error) => void
CopyButtontimeout2000Time in ms to keep the copied state before resetting.number

Related Components