MCPcopy Create free account
hub / github.com/mantinedev/ui.mantine.dev / ButtonCopy

Function ButtonCopy

lib/ButtonCopy/ButtonCopy.tsx:5–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import { useClipboard } from '@mantine/hooks';
4
5export function ButtonCopy() {
6 const clipboard = useClipboard();
7 return (
8 <Tooltip
9 label="Link copied!"
10 offset={5}
11 position="bottom"
12 radius="xl"
13 transitionProps={{ duration: 100, transition: 'slide-down' }}
14 opened={clipboard.copied}
15 >
16 <Button
17 variant="light"
18 rightSection={
19 clipboard.copied ? (
20 <IconCheck size={20} stroke={1.5} />
21 ) : (
22 <IconCopy size={20} stroke={1.5} />
23 )
24 }
25 radius="xl"
26 size="md"
27 pr={14}
28 h={48}
29 styles={{ section: { marginLeft: 22 } }}
30 onClick={() => clipboard.copy('https://www.youtube.com/watch?v=dQw4w9WgXcQ')}
31 >
32 Copy link to clipboard
33 </Button>
34 </Tooltip>
35 );
36}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected