# @salmonui/notifications/spinner API reference

> 3 exported symbols of @salmonui/notifications/spinner: 1 component, 1 interface and 1 type.

Canonical: https://salmonui.dev/docs/reference/notifications/spinner

```ts
import { … } from '@salmonui/notifications/spinner';
```

## Components

### Spinner

Kind: component

Page: https://salmonui.dev/docs/reference/notifications/spinner/Spinner

```ts
function Spinner({ label, size, loading, overlay, indicator, children, className, style, ref, ...rest }: SpinnerProps): import("react").JSX.Element | null;
```

A loading indicator. `<Spinner label="Loading orders" />` announces its
label; `<Spinner loading={pending}>{content}</Spinner>` covers content while
`loading` is true.

Props: [`SpinnerProps`](https://salmonui.dev/docs/reference/notifications/spinner/SpinnerProps) (its members are the props)

## Interfaces

### SpinnerProps

Kind: interface

Page: https://salmonui.dev/docs/reference/notifications/spinner/SpinnerProps

```ts
interface SpinnerProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
    label?: string;
    size?: SpinnerSize | number;
    loading?: boolean;
    overlay?: boolean;
    indicator?: ReactNode;
    children?: ReactNode;
    ref?: Ref<HTMLElement>;
}
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `label` | `label?: string;` | optional | Accessible loading text. With a label the spinner is a `role="status"` region carrying the visually hidden text; without one it is decorative (`aria-hidden`), and the busy state belongs to its container (`aria-busy`). |
| `size` | `size?: SpinnerSize \| number;` | optional | `'sm'` (16 px), `'md'` (24 px, default), `'lg'` (32 px) or a diameter in pixels. |
| `loading` | `loading?: boolean;` | optional | Shows the indicator (default `true`). With `children`, `loading={false}` renders only the children, and `loading` keeps their size while they are hidden and `inert`. |
| `overlay` | `overlay?: boolean;` | optional | Covers the nearest positioned ancestor with a scrim and centers the indicator. |
| `indicator` | `indicator?: ReactNode;` | optional | Replaces the built-in ring. |
| `children` | `children?: ReactNode;` | optional | Content the spinner covers while `loading`; the wrapper gets `aria-busy`. |
| `ref` | `ref?: Ref<HTMLElement>;` | optional | The root element: the spinner `<span>`, or the wrapper `<div>` when `children` are given. |

## Types

### SpinnerSize

Kind: type

Page: https://salmonui.dev/docs/reference/notifications/spinner/SpinnerSize

```ts
type SpinnerSize = 'sm' | 'md' | 'lg';
```

Spinner metric set; a number is the diameter in pixels.
