{
/** Element/tag rendered as the controller root. Defaults to `"div"`. */
as?: ElementType;
className?: string;
children?: ReactNode;
/** Fired on `clipboard:copy` — detail: `{ text }` */
onCopy?: (detail: unknown, event: CustomEvent) => void;
/** Fired on `clipboard:error` — detail: `{ error }` */
onError?: (detail: unknown, event: CustomEvent) => void;
/** Extra props are forwarded to the rendered `` element. */
[key: string]: unknown;
}
export function Clipboard(props: ClipboardProps) {
const { as, className, children, onCopy, onError, text, timeout, ...rest } = props;
const options = { text, timeout } as ClipboardOptions;
return (
{children as ReactNode}
);
}