<!-- Generated by scripts/gen-docs.mts from the JSDoc in registry/. Do not edit; run `pnpm run docs`. -->

# useLoadingVisible

Whether a loading placeholder should show: not until the load has run for `delay`, and, once shown, for at least `minVisible`. A load that ends within `delay` shows nothing, and a placeholder that shows stays for `minVisible`.

```tsx
import { useLoadingVisible } from "@/lib/ouro/use-loading-visible";
```

## Example

```tsx
const visible = useLoadingVisible(query.isPending);
return visible ? <Skeleton shape="row" count={6} /> : query.data ? <List data={query.data} /> : null;
```

## Usage

Use it to time a placeholder of your own; `Skeleton` carries no timing of its own, so an app that skips the hook pays no bytes.

## Use instead when

- Use `Button`'s `loading` instead for an action in progress.

## Parameters

| Parameter | Type | Default |
| --- | --- | --- |
| `loading` | `boolean` |  |
| `options` | `LoadingVisibleOptions` | `{}` |

## Returns

`boolean`

## Types

### `LoadingVisibleOptions`

Options for `useLoadingVisible`.

```ts
interface LoadingVisibleOptions {
  /** How long a load runs before its placeholder shows, in milliseconds. @default 200 */
  delay?: number | undefined;
  /** How long a placeholder that has shown stays, in milliseconds. @default 500 */
  minVisible?: number | undefined;
}
```
