---
layout: ~/layouts/MdxDocLayout.astro
title: "Loader"
description: "A loading spinner to indicate loading state."
sourceFile: "components/loader"
---

import ComponentExample from "~/components/docs/ComponentExample.astro";
import ComponentSection from "~/components/docs/ComponentSection.astro";
import PropsTable from "~/components/docs/PropsTable.astro";
import {
  LoaderBasicDemo,
  LoaderCustomSizeDemo,
} from "~/components/demos/LoaderDemo";

{/* Hero Demo */}

<ComponentSection>
  <ComponentExample demo="LoaderBasicDemo">
    <LoaderBasicDemo client:visible />
  </ComponentExample>
</ComponentSection>

{/* Installation */}

<ComponentSection>

## Installation

### Barrel

```tsx
import { Loader } from "@cloudflare/kumo";
```

### Granular

```tsx
import { Loader } from "@cloudflare/kumo/components/loader";
```

</ComponentSection>

{/* Usage */}

<ComponentSection>

## Usage

```tsx
import { Loader } from "@cloudflare/kumo";

export default function Example() {
  return <Loader />;
}
```

</ComponentSection>

{/* Examples */}

<ComponentSection>

## Examples

### Default Size

<ComponentExample demo="LoaderBasicDemo">
  <LoaderBasicDemo client:visible />
</ComponentExample>

### Custom Size

<ComponentExample demo="LoaderCustomSizeDemo">
  <LoaderCustomSizeDemo client:visible />
</ComponentExample>

</ComponentSection>

{/* API Reference */}

<ComponentSection>

## API Reference

  <PropsTable component="Loader" />
</ComponentSection>
