Circle V2 API Docs
    Preparing search index...

    Module @repo/utils-react

    @repo/utils-react

    @repo/utils-react provides shared React utility hooks:

    • useCopyToClipboard for copying text to the clipboard with success/error feedback.
    • useIsMac for detecting whether the user is on macOS.
    • useControllableState for components that support both controlled and uncontrolled state.
    %%{init:{"theme":"dark"}}%% flowchart LR utilsReact["@repo/utils-react"] ts["@repo/typescript-config"] vitest["@repo/vitest-config"] utilsReact -.-> ts utilsReact -.-> vitest
    %%{init:{"theme":"default"}}%% flowchart LR utilsReact["@repo/utils-react"] ts["@repo/typescript-config"] vitest["@repo/vitest-config"] utilsReact -.-> ts utilsReact -.-> vitest
    flowchart LR
      utilsReact["@repo/utils-react"]
      ts["@repo/typescript-config"]
      vitest["@repo/vitest-config"]
      utilsReact -.-> ts
      utilsReact -.-> vitest
    import { useCopyToClipboard } from "@repo/utils-react/hooks";

    function CopyButton({ text }: { text: string }) {
    const { copy, copied } = useCopyToClipboard();

    return (
    <button onClick={() => copy(text)}>
    {copied ? "Copied!" : "Copy"}
    </button>
    );
    }
    Script Description
    lint Run Biome check
    check-types Typecheck with tsc --noEmit
    test Run Vitest with coverage
    test:watch Run Vitest in watch mode

    Type Aliases

    ChangeHandler
    ClipboardItemType
    Updater

    Functions

    isMacOS
    useControllableState
    useCopyToClipboard
    useIsMac