Spinner
A small indicator that something is loading.
SourceStyles source@monoline/react 0.5.0Markdown for AI toolsstable
- Built on native elements
- role=status with an aria-label; polite, not interrupting.
- Animation stops under prefers-reduced-motion.
- Styles in one file:
13-loading.css
Import
import '@monoline/css';
import {Spinner} from '@monoline/react';
Not installed yet? Pick a route.
Copies the source and its styles into your project.
npx monoline add spinner
Usage
import {Spinner} from '@monoline/react';
<div style={{display: 'flex', gap: 'var(--s3)', alignItems: 'center'}}>
<Spinner />
<span className="muted small">Syncing 42 entries</span>
</div>
Examples
Basic
Props
SpinnerProps
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | 'Loading' | What is loading, read by screen readers. |
Data Attributes
State is exposed through attributes. Style it with these selectors, not with class toggles.
This component sets no state attributes.
CSS classes
| Class | Stylesheet |
|---|---|
.skeleton | 13-loading.css |
.skeleton-block | 13-loading.css |
.skeleton-hatch | 13-loading.css |
.spinner | 13-loading.css |
Customization
Style it with the kit's tokens in your own CSS, loaded after @monoline/css. Prefer the attributes above over extra classes. See Theming for every token.
app.css
.skeleton {
border-color: var(--accent);
}
Accessibility
- role=status with an aria-label; polite, not interrupting.
- Animation stops under prefers-reduced-motion.