# useScript > Load an external script and report its load status. - Category: DOM - Package: `hookli` (install with `npm i hookli`) - Docs: https://hookli.vercel.app/docs/use-script ## Signature ```ts useScript(src: string | null, options?: UseScriptOptions): UseScriptStatus ``` ## Parameters - `src`: `string | null` — The script URL to load, or null to skip loading and stay idle. - `options`: `UseScriptOptions` (default: `{}`) — Optional shouldPreventLoad and removeOnUnmount flags. ## Returns - `status`: `UseScriptStatus` — The current load status: "idle" | "loading" | "ready" | "error". ## Types ### UseScriptStatus - `value`: `"idle" | "loading" | "ready" | "error"` — Lifecycle of the injected script tag. ### UseScriptOptions Flags controlling when the script loads and unloads. - `shouldPreventLoad`: `boolean` (default: `false`) — Keep the status "idle" without injecting the script — useful for deferring a load. - `removeOnUnmount`: `boolean` (default: `false`) — Remove the injected