Animated list
A list whose items enter one by one without shifting the layout.
SourceStyles source@monoline/react 0.4.0Markdown for AI toolsstable
- Built on native elements
- A real <ul> with <li> items, so list semantics and counts are announced.
- Items fade in with opacity only and keep their space from the first frame; there is no layout shift.
- With prefers-reduced-motion all items are visible at once.
- Styles in one file:
animated-list.css
Import
import '@monoline/css';
import {AnimatedList} from '@monoline/react';
Not installed yet? Pick a route.
Copies the source and its styles into your project.
npx monoline add animated-list
Usage
import {AnimatedList} from '@monoline/react';
const row = (t: string, d: string) => (
<div style={{display: 'grid', gap: 'var(--s1)', padding: 'var(--s3) var(--s4)', border: '1px solid var(--rule)'}}>
<strong>{t}</strong><span style={{color: 'var(--muted)', fontSize: 'var(--text-sm)'}}>{d}</span>
</div>
);
<AnimatedList style={{display: 'grid', gap: 'var(--s2)', maxWidth: '24rem'}}>
{row('Build passed', 'main, 2 minutes ago')}
{row('Review requested', 'Docs update, 5 minutes ago')}
{row('Deploy finished', 'Production, 9 minutes ago')}
</AnimatedList>
Examples
Activity
Props
AnimatedListProps
| Prop | Type | Default | Description |
|---|---|---|---|
interval | number | 300 | Milliseconds between one item entering and the next. Default 300. |
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 |
|---|---|
.animated-list | animated-list.css |
.animated-list-item | animated-list.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
.animated-list {
border-color: var(--accent);
}
Accessibility
- A real <ul> with <li> items, so list semantics and counts are announced.
- Items fade in with opacity only and keep their space from the first frame; there is no layout shift.
- With prefers-reduced-motion all items are visible at once.