Socket
Socket
Sign inDemoInstall

@contentful/f36-copybutton

Package Overview
Dependencies
6
Maintainers
4
Versions
317
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @contentful/f36-copybutton

Forma 36: CopyButton component


Version published
Weekly downloads
17K
decreased by-3.86%
Maintainers
4
Created
Weekly downloads
 

Readme

Source

title: 'CopyButton' type: 'component' status: 'stable' section: 'buttonComponents' slug: /components/copy-button/ github: 'https://github.com/contentful/forma-36/tree/main/packages/components/copybutton' typescript: ./src/CopyButton.tsx storybook: 'https://f36-storybook.contentful.com/?path=/story/components-copybutton--default'

Copy text to the clipboard.

Place it at the right bottom end of the text you want users to copy.

Import

import { CopyButton } from '@contentful/f36-components';
// or
import { CopyButton } from '@contentful/f36-copybutton';

Examples

Basic

Changing the tooltip

You can modify tooltip text and its placement by using the following properties: tooltipCopiedText, tooltipText and tooltipProps.

To read more about all possible values of tooltipProps object, refer to Tooltip documentation.

Using with TextInput

Using with promises

Sometimes you want to await a Promise before know the value to copy to the clipboard. You can do this in the code where the copy button is implemented.

Accessibility

You can pass a custom aria-label through the label prop.

Props (API reference)

FAQs

Last updated on 26 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc