Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vale/styles/FernStyles/Acronyms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,4 @@ exceptions:
- FDR
- SSR
- SSG
- REST
3 changes: 3 additions & 0 deletions fern/products/docs/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ navigation:
path: ./pages/component-library/default-components/code-blocks.mdx
icon: fa-duotone fa-code
slug: code-blocks
- page: Copy
path: ./pages/component-library/default-components/copy.mdx
icon: fa-duotone fa-copy
- page: Download
path: ./pages/component-library/default-components/download.mdx
icon: fa-duotone fa-download
Expand Down
12 changes: 12 additions & 0 deletions fern/products/docs/pages/changelog/2025-11-08.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## New Copy component for inline copyable text

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[FernStyles.Adverbs] Remove 'quickly' if it's not important to the meaning of the statement.


You can also customize what gets copied to the clipboard using the `clipboard` prop. This is useful when you want simplify commands, versions, or URLs for readability while copying complete values.

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

Read more in the [Copy component documentation](/learn/docs/writing-content/components/copy).
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: Copy
description: Make text copyable with a click-to-copy button.
---

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

<div className="highlight-frame">
<div className="highlight-frame-content">
Use the Fern CLI to build and consume REST APIs. The current version is <Copy>v2.0</Copy>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[FernStyles.Acronyms] 'REST' has no definition.

</div>
</div>

```jsx Markdown
Use 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.

<div className="highlight-frame">
<div className="highlight-frame-content">
Install the CLI using <Copy clipboard="npm install -g bamboo-leaf-cli">npm install</Copy>
</div>
</div>

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

## Properties

<ParamField path="children" type="string | ReactNode" required={true}>
The text content to display and make copyable. This is what users see on the page.
</ParamField>

<ParamField path="clipboard" type="string" required={false}>
Custom text to copy to the clipboard. Use this when you want to display one value but copy a different value.
</ParamField>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: 'Components overview'
description: 'Built-in components for creating interactive documentation'
---

Fern includes 20 built-in components for creating interactive documentation. Select a component below to view usage examples and configuration options.
Fern includes 21 built-in components for creating interactive documentation. Select a component below to view usage examples and configuration options.

<CardGroup cols={3}>
<Card
Expand Down Expand Up @@ -62,6 +62,13 @@ Fern includes 20 built-in components for creating interactive documentation. Sel
>
Code examples with syntax highlighting and interactive features
</Card>
<Card
title="Copy"
icon="fa-duotone fa-clipboard"
href="/docs/writing-content/components/copy"
>
Make text copyable with a click-to-copy button
</Card>
<Card
title="Download"
icon="fa-duotone fa-download"
Expand Down
Loading