SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

CopyButton

Client island: the copy button a code block carries.

View code
tsx
<Input id="api-key" readOnly value="up_test_4f9c2a7e1b" aria-label="API key" />
<CopyButton target="api-key" label="Copy API key" copiedLabel="Copied" />

Demo docs sites

Whole pages built only from @sdxc/ui, each for an invented product with its own palette and type. They open in a new tab.

Every demo, landings and docs sites alike, is listed in the demo gallery.

Installation

An ordinary dependency: install it, import the theme once, and import the component where it is used.

Terminal
npm add @sdxc/ui remix
typescript
import "@sdxc/ui/theme.css";

Usage

typescript
import { CopyButton } from "@sdxc/ui/docs";

Renders the button. The island loads from the bare @sdxc/ui/docs/copy-button specifier, which the app's browser entry maps to a dynamic import; until then the button is inert and the code beside it stays selectable.

Props

Read from the component's own types, so every prop, every default and every allowed value is listed.

@sdxc/ui

Can’t find it? Contact us