Overview Button Copy button Field Input Number field Textarea Select Combobox Multiselect Date picker Date range picker Date-time picker Checkbox Radio group Position picker Switch Slider Dropzone Device controls Avatar Badge Card Collapsible Kbd Map Matrix Proportion bar Separator Stat Table Timeline Chat Playback Pagination Charts Chart theming Profile chart Time series chart Bar chart Isopleth chart TS diagram Box plot Rose chart Calendar chart Banner Toast Loader Progress Skeleton Empty state Error state Dropdown menu Tooltip Info tooltip Dialog Sheet Resizable Confirm dialog Breadcrumbs Command palette Mobile menu Navigation list Outline Scroll rail Sidebar Tabs
Copy button
Two ways to copy a value, with the same feedback: the copy icon shrinks into a check, the tooltip says Copied, and screen readers hear it. CopyButton is a Button; CopyField is the value itself.
Playground
Click it, then paste somewhere.
Variant
Size
<CopyButton value={mmsi} /> Next to a value
Icon only, small and ghost, right after what it copies. The tooltip names what will be copied.
MMSI 259040560
Position 60.3913° N, 5.3221° E
Copy field
The value is the button. Hover it and the copy icon slides in; click and it turns into a check. Tap it on a phone and the check slides in on its own.
Variant
<CopyField value={project.reference} /> In a meta line
Plain fields read as part of the line until hovered: the project number and the customer's reference.
Vestland Marin AS
Which one
- The value is already on screen and short: make it a CopyField, so the thing you see is the thing you click.
- The value is long, hidden, or sits in a label and value pair: a CopyButton after it, icon only, ghost and xs.
- A copy action among other buttons, in a toolbar or a dialog footer: a CopyButton.
- Keys and hashes read character by character get mono. IDs and references don't.