---
title: Skeleton
description: Skeleton is a placeholder that shows the shape of content while it loads.
category: Feedback
related: [Table, Text, ProgressBar]
---

Source: https://clickhouse.design/click-ui/skeleton

# Skeleton

Skeleton is a placeholder for content that is still loading. Use it where the layout is known but the data is not, so the page keeps its shape instead of jumping when content arrives. Available from Click UI 0.16.0.

## Example

## Props

Skeleton has two shapes. `text` (the default) draws lines of text and takes `size` and `lines`. `rectangle` draws a box and takes `height`. The props of one shape are not accepted by the other.

| Prop   | Type                    | Default value      | Description                                                              |
| ------ | ----------------------- | ------------------ | ------------------------------------------------------------------------ |
| shape  | `"text" \| "rectangle"` | `"text"`           | Whether to draw lines of text or a box                                   |
| width  | `string`                | `fills the parent` | Any CSS width, for example 60% or 6rem                                   |
| size   | `"sm" \| "md"`          | `"md"`             | Text shape only. Each line is as tall as a line of Text at the same size |
| lines  | `number`                | `1`                | Text shape only. Number of lines. The last of several lines is 75% wide  |
| height | `string`                | `fills the parent` | Rectangle shape only. Any CSS height, for example 4rem                   |

```tsx
import { Skeleton } from '@clickhouse/click-ui'

<Skeleton lines={3} />
<Skeleton shape="rectangle" height="6rem" />
```

## Quick start

```tsx
import { Skeleton, Text } from '@clickhouse/click-ui'

function Description({ loading, text }: { loading: boolean; text: string }) {
  if (loading) {
    return <Skeleton lines={2} />
  }
  return <Text>{text}</Text>
}
```

## Accessibility

A skeleton is decorative. Tell assistive technology that the region is loading yourself, for example with `aria-busy="true"` on the container that will receive the content. Skeletons on screen together share one shimmer sweep, and the fill is static when the user prefers reduced motion.

## Related components

- **Table**: Shows skeleton rows itself with `loadingVariant="skeleton"`.
- **Text**: A text skeleton matches the line height of Text at the same size.
- **ProgressBar**: Use when you can report how far a task has progressed.

## Common use cases

### Card placeholder

```tsx
import { Skeleton, Container } from '@clickhouse/click-ui'

function CardPlaceholder() {
  return (
    <Container orientation='horizontal' gap='md' fillWidth alignItems='start'>
      <Skeleton shape='rectangle' width='4rem' height='4rem' />
      <Container orientation='vertical' gap='sm' fillWidth>
        <Skeleton width='40%' />
        <Skeleton size='sm' lines={2} />
      </Container>
    </Container>
  )
}
```
