# Spinner

> Cherry Spinner component - a rotating loading indicator built on the Icon component with theme-aware color.

Source: https://docs.cherry.al/v1/code/spinner

> For the complete documentation index, see [llms.txt](https://docs.cherry.al/llms.txt).

# Spinner

<Preview bleed>
<iframe className="light-only" src="https://v1.cherry.al/preview/spinner?theme=light" title="Spinner" loading="lazy" style={{ width: "100%", height: "320px" }} />
<iframe className="dark-only" src="https://v1.cherry.al/preview/spinner?theme=dark" title="Spinner" loading="lazy" style={{ width: "100%", height: "320px" }} />

```jsx
import React from "react";
import { Spinner } from "cherry-styled-components";

export default function Loading() {
  return <Spinner aria-label="Loading" />;
}
```
</Preview>

The Spinner component is a rotating loading indicator: a Lucide icon spinning once per second. It is built on the [Icon](/v1/code/icon) component, so any Lucide glyph can spin, and it accepts Icon's props unchanged - note that, as with Icon, they are not `$`-prefixed.

Any other glyph spins the same way: `<Spinner icon={Loader} size={32} />` with `Loader` imported from `lucide-react`.

The [chat kit](/v1/code/chat)'s send button swaps its arrow for a Spinner while a reply is streaming.

## Properties

<Field value="icon" type="IconComponent">
  The Lucide glyph to rotate, imported from `lucide-react`. Defaults to `LoaderCircle`.
</Field>

<Field value="color" type="string">
  Stroke color. By default the spinner resolves its color from the theme (`colors.dark`) rather than inheriting, so it stays visible on either mode's surface.
</Field>

<Field value="size" type="number">
  Size in pixels, applied to both width and height. Defaults to Icon's 24px.
</Field>

<Field value="aria-label" type="string">
  Accessible label. Without one the icon is decorative (`aria-hidden`), so add a label when the spinner is the only loading signal.
</Field>

<Callout type="note">
  Under `prefers-reduced-motion: reduce` the rotation is disabled and the icon renders static.
</Callout>

<Button href="https://github.com/cherry-design-system/styled-components/blob/main/src/lib/spinner.tsx" icon="code" iconPosition="left">
  View Source
</Button>
