@sigx/lynx-clipboard
v0.4.0
Published
Clipboard access for sigx-lynx
Maintainers
Readme
@sigx/lynx-clipboard
System clipboard access for sigx-lynx. UIPasteboard on iOS, ClipboardManager on Android.
Install
pnpm add @sigx/lynx-clipboardNo special permissions — sigx prebuild auto-discovers and links the native module.
Usage
import { Clipboard } from '@sigx/lynx-clipboard';
Clipboard.setString('Hello, world!');
const text = await Clipboard.getString();
const isPopulated = await Clipboard.hasString();API
| Method | Notes |
| ------------------------------------- | -------------------------------------------------------------------------------------------------- |
| setString(text: string): void | Sync write. |
| getString(): Promise<string> | Async — both platforms can prompt the user (iOS 14+ shows a "Pasted from …" toast). |
| hasString(): Promise<boolean> | Whether the clipboard currently contains a string. |
| isAvailable(): boolean | Whether the native module is registered in the current build. |
Gotchas
- iOS 14+ toast. Reading the clipboard surfaces a system-level "Pasted from " notification. Don't poll — call
getString()only on user intent (paste button, etc.).
Reference app
examples/lynx-one/my-sigx-app/src/cards/ClipboardCard.tsx covers a copy/paste round-trip with hasString() gating.
