useClipboard

useClipboard is a custom hook that handles copying content to clipboard.

Return value#

The useClipboard hook returns an object with the following fields:

NameTypeDefaultDescription
valuestringThe copied value.
onCopyfunctionCallback function to copy content.
hasCopiedbooleanfalseIf true, the content has been copied .

Import#

import { useClipboard } from "@chakra-ui/react"

Usage#

Paste here
Editable Example
Edit this page