Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 491 Bytes

README.md

File metadata and controls

28 lines (22 loc) · 491 Bytes

Figma Hooks

WIP

useCopyToClipboard

Leverages deprecated document.execCommand in the absence of a Clipboard API

import * as React from 'react'
import { useCopyToClipboard } from 'figma-hooks'

export default function Example() {
  const { copy } = useCopyToClipboard({
    contents: 'Some stuff',
    logger: console,
  })

  return (
    <div>
      <h1>Copy to Clipboard</h1>
      <button type='button' onClick={copy}>
        Copy
      </button>
    </div>
  )
}