Components/Mechanisms
Interactive docs page: https://wix-pages.com/design-system-documentation/#/component/copyclipboard
CopyClipboard is a function mechanism that wraps other components to provide copy/paste functionality. Use it to copy urls, code snippets or similar.
- Use it to let users copy values they need elsewhere, such as URLs or code snippets.
- Show users that the value was copied, such as by changing the button text when isCopied is true.
- Set resetTimeout so the confirmation goes away after a short time.
- Don't copy to the clipboard without a user action, such as on page load.
- Don't use it to display code. Use
<CodeSnippet/>, which has its own copy action.
Component can be used with an input with a button. Once the item is copied the interface should respond with a timeout message.
| Name | Type | Default | Description |
|---|
children (required) | (params: CopyClipboardChildrenProps) => ReactNode | — | Children render prop provides handlers to invoke copying to the clipboard. |
className | string | — | |
dataHook | string | — | Applied as data-hook HTML attribute that can be used in the tests. |
onCopy | () => void | — | Defines a callback function which is called after the value is copied to the clipboard. |
resetTimeout | number | — | Interval after which state of whether value was copied is reset. |
value (required) | string | — | Text to be added to clipboard. |
Import the driver matching your test environment:
| Method | Description |
|---|
exists | Checks whether the component found with the given data hook. |
element | Gets the component root element. |
click | Clicks on the component root element. |
base | Returns UniDriver for the base element. |
- 1.339.0 (2026-10-19) — maintenance release, no component-specific changes
- 1.338.0 (2026-10-15) — maintenance release, no component-specific changes
- 1.331.0 (2026-10-01) — maintenance release, no component-specific changes
- 1.325.0 (2026-09-17) — maintenance release, no component-specific changes
- 1.310.0 (2026-08-10) — maintenance release, no component-specific changes
- 1.292.0 (2026-06-22) — maintenance release, no component-specific changes
- 1.267.0 (2026-04-09) — maintenance release, no component-specific changes
- 1.266.0 (2026-04-07) — maintenance release, no component-specific changes
- 1.260.0 (2026-03-17) — maintenance release, no component-specific changes
- 1.254.0 (2026-02-03) — maintenance release, no component-specific changes
- 1.220.0 (2025-09-29) — maintenance release, no component-specific changes
- 1.160.0 (2025-02-06) — maintenance release, no component-specific changes
- 1.143.1 (2024-11-27) — maintenance release, no component-specific changes
- 1.116.0 (2024-07-22) — maintenance release, no component-specific changes
- 1.93.0 (2024-02-08) — maintenance release, no component-specific changes
- 1.92.1 (2024-02-05) — maintenance release, no component-specific changes