Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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
13 changes: 13 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,13 @@
## 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 to display formatted text but copy plain text or a different value.

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

If you want the full version, you can use the <Copy clipboard="foobopbar">v1.0</Copy> version.
```

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 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.


## Usage

<div className="highlight-frame">
<div className="highlight-frame-content">
Use the Fern CLI to build and consume REST APIs. The latest 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.

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.Current] Avoid time-relative terms like 'latest' that become outdated

</div>
</div>

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

## Variants

### Custom clipboard content

You can customize what gets copied to the clipboard using the `clipboard` prop. This is useful when you want to display formatted text but copy plain text or a different value.

<div className="highlight-frame">
<div className="highlight-frame-content">
If you want the full version, you can use the <Copy clipboard="foobopbar">v1.0</Copy> version.
</div>
</div>

```jsx Markdown
If you want the full version, you can use the <Copy clipboard="foobopbar">v1.0</Copy> version.
```

## 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. If not specified, the component copies the children content. Use this when you want to display one value but copy a different value.
</ParamField>