Copy

View as Markdown

The <Copy> component makes text copyable with a single click. Use it inline to allow readers to copy version numbers, commands, API keys, or other text snippets without selecting and copying manually.

Usage

Use the Fern CLI to build and consume REST APIs. The current version is v2.0.

Markdown
1Use the Fern CLI to build and consume REST APIs. The current version is <Copy>v2.0</Copy>.

Variants

Custom clipboard content

Use the clipboard prop to display one value while copying a different value to the clipboard. This is useful when you want simplify commands, versions, or URLs for readability while copying complete values.

Install the CLI using npm install

Markdown
1Install the CLI using <Copy clipboard="npm install -g bamboo-leaf-cli">npm install</Copy>

Properties

children
string | ReactNodeRequired

The text content to display and make copyable. This is what users see on the page.

clipboard
string

Custom text to copy to the clipboard. Use this when you want to display one value but copy a different value.