Copy Prefab

v1.0

Copy Button

Copies text data to the clipboard when the user clicks the framer component.

Why use this prefab?

Framer provides a copy button but its capabilities are limited and not quite accessible. The copy button prefab converts any component into a copy to clipboard and applies the proper aria-labels depending on the state of the copy button.

Why use this prefab?

Framer provides a copy button but its capabilities are limited and not quite accessible. The copy button prefab converts any component into a copy to clipboard and applies the proper aria-labels depending on the state of the copy button.

Why use this prefab?

Framer provides a copy button but its capabilities are limited and not quite accessible. The copy button prefab converts any component into a copy to clipboard and applies the proper aria-labels depending on the state of the copy button.

Features

Features

Features

Uses framer interactions for transition between variants

Use within any framer component.

Applies all accessible aria attributes to ensure everyone can interact with it.

Uses native HTML Form attribute to use within any form.

How to use

How to use

How to use

Create a framer component: Using framer create a component that will use this prefab.

Add prefab: Add the prefab to the component and connect the transitions to the matching variants states.

Nest prefab: Nest prefab to the parent frame. Set the prefab position to absolute. Keep in mind that the prefab will not show visually in preview or when publish.

Test: Test the component in preview and ensure that your transitions are working.

Done: That is it! You are all set to use this prefab.

Accessbility considerations

Accessbility considerations

Accessbility considerations

When creating the component that will be used with this prefab consider the following:

When creating your component that will use this prefab ensure that there is sufficient contrast between the different states. Read more about required contrast to pass AA WCAG requirements

This prefab sets the default div to role="button" avoid setting the parent frame as a button conflicting with the role attribute.

There are three aria-labels that change depending if it was successful, error, or ready to copy. Make it the labels as clear as possible to what the user is copying.

Properties

Properties

Properties

Property

Default

Description

Copy Data

String

The string data that will copied to users clipboard.

Aria-Default

String

The default accessible label when the button is ready to copy.

Aria-Success

String

The accessible label when the button has successfully copied.

Aria-Error

String

The accessible label when the button has failed to copied.

Timeout

String

When the button will reset after the users attempts to copy.

Events

Interactions

Supported events: Default, Copying, Success,Error