File tree Expand file tree Collapse file tree 9 files changed +90
-0
lines changed
react/src/components/clipboard
solid/src/components/clipboard
svelte/src/lib/components/clipboard
vue/src/components/clipboard
website/src/content/pages/components Expand file tree Collapse file tree 9 files changed +90
-0
lines changed Original file line number Diff line number Diff line change @@ -11,3 +11,4 @@ export { Context } from './examples/context'
11
11
export { Controlled } from './examples/controlled'
12
12
export { CustomTimeout } from './examples/custom-timeout'
13
13
export { RootProvider } from './examples/root-provider'
14
+ export { ValueText } from './examples/value-text'
Original file line number Diff line number Diff line change
1
+ import { Clipboard } from '@ark-ui/react/clipboard'
2
+ import { CheckIcon , ClipboardCopyIcon } from 'lucide-react'
3
+
4
+ export const ValueText = ( ) => {
5
+ return (
6
+ < Clipboard . Root value = "https://ark-ui.com" >
7
+ < Clipboard . ValueText />
8
+ < Clipboard . Trigger >
9
+ < Clipboard . Indicator copied = { < CheckIcon /> } >
10
+ < ClipboardCopyIcon />
11
+ </ Clipboard . Indicator >
12
+ Copy
13
+ </ Clipboard . Trigger >
14
+ </ Clipboard . Root >
15
+ )
16
+ }
Original file line number Diff line number Diff line change @@ -11,3 +11,4 @@ export { Context } from './examples/context'
11
11
export { Controlled } from './examples/controlled'
12
12
export { CustomTimeout } from './examples/custom-timeout'
13
13
export { RootProvider } from './examples/root-provider'
14
+ export { ValueText } from './examples/value-text'
Original file line number Diff line number Diff line change
1
+ import { Clipboard } from '@ark-ui/solid/clipboard'
2
+ import { CheckIcon , ClipboardCopyIcon } from 'lucide-solid'
3
+ import { Show } from 'solid-js'
4
+
5
+ export const ValueText = ( ) => {
6
+ return (
7
+ < Clipboard . Root value = "https://ark-ui.com" >
8
+ < Clipboard . ValueText />
9
+ < Clipboard . Trigger >
10
+ < Clipboard . Indicator >
11
+ < Show when = { false } fallback = { < ClipboardCopyIcon /> } >
12
+ < CheckIcon />
13
+ </ Show >
14
+ </ Clipboard . Indicator >
15
+ Copy
16
+ </ Clipboard . Trigger >
17
+ </ Clipboard . Root >
18
+ )
19
+ }
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import ContextExample from './examples/context.svelte'
4
4
import ControlledExample from './examples/controlled.svelte'
5
5
import CustomTimeoutExample from './examples/custom-timeout.svelte'
6
6
import RootProviderExample from './examples/root-provider.svelte'
7
+ import ValueTextExample from './examples/value-text.svelte'
7
8
8
9
const meta : Meta = {
9
10
title : 'Components/Clipboard' ,
@@ -40,3 +41,9 @@ export const RootProvider = {
40
41
Component : RootProviderExample ,
41
42
} ) ,
42
43
}
44
+
45
+ export const ValueText = {
46
+ render : ( ) => ( {
47
+ Component : ValueTextExample ,
48
+ } ) ,
49
+ }
Original file line number Diff line number Diff line change
1
+ <script lang =" ts" >
2
+ import { CheckIcon , ClipboardCopyIcon } from ' lucide-svelte'
3
+ import { Clipboard } from ' @ark-ui/svelte/clipboard'
4
+ </script >
5
+
6
+ <Clipboard .Root value =" https://ark-ui.com" >
7
+ <Clipboard .ValueText />
8
+ <Clipboard .Trigger >
9
+ <Clipboard .Indicator >
10
+ <ClipboardCopyIcon />
11
+ {#snippet copied ()}
12
+ <CheckIcon />
13
+ {/ snippet }
14
+ </Clipboard .Indicator >
15
+ Copy
16
+ </Clipboard .Trigger >
17
+ </Clipboard .Root >
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import Context from './examples/context.vue'
4
4
import Controlled from ' ./examples/controlled.vue'
5
5
import CustomTimeout from ' ./examples/custom-timeout.vue'
6
6
import RootProvider from ' ./examples/root-provider.vue'
7
+ import ValueText from ' ./examples/value-text.vue'
7
8
</script >
8
9
<template >
9
10
<Story title =" Clipboard" >
@@ -22,5 +23,8 @@ import RootProvider from './examples/root-provider.vue'
22
23
<Variant title =" RootProvider" >
23
24
<RootProvider />
24
25
</Variant >
26
+ <Variant title =" ValueText" >
27
+ <ValueText />
28
+ </Variant >
25
29
</Story >
26
30
</template >
Original file line number Diff line number Diff line change
1
+ <script setup lang="ts">
2
+ import { Clipboard } from ' @ark-ui/vue/clipboard'
3
+ import { CheckIcon , ClipboardCopyIcon } from ' lucide-vue-next'
4
+ </script >
5
+
6
+ <template >
7
+ <Clipboard .Root default-value =" https://ark-ui.com" >
8
+ <Clipboard .ValueText />
9
+ <Clipboard .Trigger >
10
+ <Clipboard .Indicator >
11
+ <ClipboardCopyIcon />
12
+ <template #copied >
13
+ <CheckIcon />
14
+ </template >
15
+ </Clipboard .Indicator >
16
+ Copy
17
+ </Clipboard .Trigger >
18
+ </Clipboard .Root >
19
+ </template >
Original file line number Diff line number Diff line change @@ -48,6 +48,12 @@ Configure the copy status timeout duration using the `timeout` prop. Default is
48
48
49
49
<Example id = " custom-timeout" />
50
50
51
+ ### Value Text
52
+
53
+ Use ` Clipboard.ValueText ` to display the current clipboard value.
54
+
55
+ <Example id = " value-text" />
56
+
51
57
## API Reference
52
58
53
59
<ComponentTypes id = " clipboard" />
You can’t perform that action at this time.
0 commit comments