GithubYarn FigmaEndringslogg
Intro
En utility-komponent som lett lar deg kopiere noe til utklippstavle. Brukt i interne løsninger for å raskt kopiere nyttig informasjon.
Egnet til å:
- Kopiere innhold til utklippstavle
Har du innspill til komponenten?
Send forslagEksempler
Props
CopyToClipboard
- children? ReactNode
- Button text
- copyText string
- Text to be copied to clipboard
- 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>
- CopyToClipboard extends HTMLButtonElement
Tokens
Token | Fallback |
--ac-copy-to-clipboard-text | --a-text-default |