clipboard.writeText
Puts text on the clipboard, replacing its content.
Usage
Copy text and offer a paste action
import { Pressable, Text, VStack, clipboard, signal } from 'kuito';
export function InviteCode() {
const pasted = signal('');
return (
<VStack gap={12}>
<Pressable onPress={() => void clipboard.writeText('KUITO-2026')}>
<Text>Copy the code</Text>
</Pressable>
<Pressable
disabled={!clipboard.hasText.value}
onPress={() => {
void clipboard.readText().then((text) => {
pasted.value = text;
});
}}
>
<Text>{clipboard.hasText.value ? 'Paste' : 'Nothing to paste'}</Text>
</Pressable>
<Text>{pasted.value}</Text>
</VStack>
);
}Signatures
(text: string): Promise<void>Parameters
| Name | Type | Required | Description |
|---|---|---|---|
text | string | Yes | — |
Returns
Promise<void>
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.