Skip to content

Copy button API

import { CopyButton } from '@cimpress-ui/react';

CopyButton can be activated by pressing Enter or Space, similar to a native HTML button.

Icon-only copy button should have an aria-label prop defined to identify the function of the button to assistive technologies. See our accessibility guide for more details.

Displays a button that allows users to copy a specific value to clipboard.

See copy button usage guidelines.

Ref<HTMLButtonElement>

The ref type for this component.

CopyButtonProps
string

The content to be copied.

'small' | 'medium' | 'large'

The size of the button.

Defaults to 'medium' .
StringLikeChildren

The text displayed on the button.

'secondary' | 'tertiary'

Determines the visual appearance of the button.

Defaults to 'secondary' .
string

The description that appears in a tooltip when the user hovers or focuses the button.

() => void

A handler that gets called when the user triggers the copying.

string

The element's unique identifier. See MDN.

boolean

Use this attribute to "claim" the component tree for exclusive Cimpress UI usage.

string

Sets the CSS className for the element. Only use as a last resort. Use style props instead.

See styling guide.

CSSProperties

Sets the CSS style for the element. Only use as a last resort. Use style props instead.

See styling guide.

string

Defines a string value that labels the current element.

string

Identifies the element (or elements) that labels the current element.

string

Identifies the element (or elements) that describes the object.

string

Identifies the element (or elements) that provide a detailed, extended description for the object.

boolean

Whether the button is disabled.

(e: HoverEvent) => void

Handler that is called when a hover interaction starts.

(e: HoverEvent) => void

Handler that is called when a hover interaction ends.

StyleProps
Responsive<Spacing | "auto">

The amount of margin applied to all edges of this component.

Responsive<Spacing | "auto">

The amount of margin applied to the left and right edges of this component. Takes priority over margin.

Responsive<Spacing | "auto">

The amount of margin applied to the top and bottom edges of this component. Takes priority over margin.

Responsive<Spacing | "auto">

The amount of margin applied to the top edge of this component. Takes priority over marginY and margin.

Responsive<Spacing | "auto">

The amount of margin applied to the right edge of this component. Takes priority over marginX and margin.

Responsive<Spacing | "auto">

The amount of margin applied to the bottom edge of this component. Takes priority over marginY and margin.

Responsive<Spacing | "auto">

The amount of margin applied to the left edge of this component. Takes priority over marginX and margin.