Rain
A looping character-art rain animation with adjustable trails and dimensions.
Install
pnpm add @fractaldesign/machines-ui import '@fractaldesign/machines-ui/style.css';
import { GraphRain } from '@fractaldesign/machines-ui';Preview
glyph rain
<GraphRain title="RAIN" cols={48} rows={12} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title* | string | — | Caption drawn on the top edge as `[ TITLE ]`. Uppercase, 1–2 words. |
| animated | boolean | true | Animate the rain. Default true. Reduced motion freezes a single frame. |
| cols | number | 56 | Width in character columns. Default 56. |
| rows | number | 16 | Height in rows. Default 16. |
| speedMs | number | 110 | Milliseconds per tick. Default 110. |
| trail | number | 8 | Trail length behind each head. Default 8. |
| seedNum | number | 5 | Seed for the reproducible rain. Default 5. |
| label | string | 'glyph rain' | Short caption under the art; the art itself is decorative. |
| class | string | '' |
API
- class forwarded to the outer element
- motion runs live; set animated={false} to freeze
- a11y honours prefers-reduced-motion
Types
| Name | Kind | Description |
|---|---|---|
| Drop | interface | |
| Seg | interface |
Theming
CSS custom properties this component reads.
- --graph-accent
- --text-muted
- --text-primary
- --text-secondary
Related
Built from
src/lib/components/animated/GraphRain.svelte