Clipboard
Clipboard provides a copy-to-clipboard button that shows visual feedback when the text has been copied.
Basic Usage
import { Clipboard } from "@paramanu/data-display-react"
export default function App() {return <Clipboard value="npm install @paramanu/data-display-react" />}<button type="button" class="pm-clipboard pm-clipboard--md" aria-label="Copy to clipboard">Copy</button>Accessibility
- Btn has appropriate
aria-labelthat changes to indicate the copied state.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
size | "sm" | "md" | "lg" | "md" | Padding and icon size |
value | string | - | Text to copy |
timeout | number | 2000 | Duration of the copied state in ms |