Intro
Egnet til:
- Bruk på interne flater
- Kopi av relevant tekst
Deprecated
Props
CopyToClipboard
- children? ReactNode
- Button text
- copyText string
- Text to be copied to clipboard
- onClick? ((event: MouseEvent<HTMLElement, MouseEvent>) => void)
- Callback function triggered when clicking the button
- popoverText string
- Description of text. Example: "Kopierte personnummer til clipboard"
- popoverPlacement?"top" | "bottom" | "right" | "left" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end"
- Allows extending popover properties like "placement"
- title?string
- Copy button title attribute
- variant? "tertiary"
- Components i tertiary by default. Will be removed in v2.0.0 @breaking v2
- size?"medium" | "small" | "xsmall"
- Changes padding, height and font-size
- disabled? boolean
- Prevent the user from interacting with the button: it cannot be pressed or focused. @note Avoid using if possible for accessibility purposes
- icon? ReactNode
- Button Icon
- iconPosition?"right" | "left"
- Icon position in Button
- className? string
- ref? Ref<HTMLButtonElement>
- Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom
- CopyToClipboard extends HTMLButtonElement