# Skeleton

> Placeholder lines in the shape of content that is loading.

```tsx
import { Skeleton } from '@brand-studio/ui';

export default function SkeletonDemo() {
  return (
    <div style={{ display: 'grid', gap: 24, width: '100%', maxWidth: 380 }}>
      <Skeleton avatar lines={2} label="Loading your profile" />
      <Skeleton lines={3} label="Loading tasting notes" />
    </div>
  );
}
```

## Installation

```sh
npm install @brand-studio/ui
```

React 18 or 19 is a peer dependency. Import the stylesheet once and wrap the app in a brand theme:

```tsx
import '@brand-studio/ui/styles.css';
import { BrandTheme, Skeleton } from '@brand-studio/ui';
import brand from './brand.json';

<BrandTheme palette={brand.tokens} mode="system">
  {/* your app */}
</BrandTheme>
```

## Usage

```tsx
import { Skeleton } from '@brand-studio/ui';
```

```tsx
<Skeleton avatar lines={2} label="Loading your profile" />
```

## Accessibility

- Screen readers hear `label` once through `role="status"`. The grey shapes are hidden from them.
- The shimmer stops under reduced motion; the shapes stay.
- Match the shape of the content that replaces it, so the page does not jump when it loads.

## API Reference

| Prop | Type | Default |
|---|---|---|
| `lines?` | `number` | `3` |
| `avatar?` | `boolean` | `false` |
| `label?` | `string` | `'Loading'` |
| `className?` | `string` | `''` |

Source: https://brandstudio.js.org/docs/components/skeleton/
