#092
Animated
A progress bar that fills from 0 to 100 percent in steps of 5 every 100 ms when Start upload is clicked.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Animated" pattern (@codeatlasdev/ui demo #092, feedback/progress) in my app.
Call get_demo({ ids: ["#092"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Showing upload or export progress that the app updates as work completes.
Keep these library parts, with the props and tokens the demo uses:
- Progress, Button from "@codeatlasdev/ui"
Behaviour to keep:
- `<Progress {value} label="Upload progress" />` with `let value = $state(0)`
- `setInterval` runs every `100` ms with `value = Math.min(100, value + 5)` and clears at 100
- Percent text `{value}%` shown beside the bar
- Button `<Button variant="outlined" size="sm" disabled={running} onclick={start}>` switches label with `{running ? 'Uploading…' : 'Start upload'}`
- `onDestroy(() => clearInterval(timer))` cleans the timer
- Column wrapper has `max-width: 480px`
Reduced motion: the demo handles it; keep that branch.
Keyboard: operable; keep the focus order and key handling.
Change only the copy and the data. Use the theme tokens (--ca-*), never raw colours. Library parts
How it is built
- `<Progress {value} label="Upload progress" />` with `let value = $state(0)`
- `setInterval` runs every `100` ms with `value = Math.min(100, value + 5)` and clears at 100
- Percent text `{value}%` shown beside the bar
- Button `<Button variant="outlined" size="sm" disabled={running} onclick={start}>` switches label with `{running ? 'Uploading…' : 'Start upload'}`
- `onDestroy(() => clearInterval(timer))` cleans the timer
- Column wrapper has `max-width: 480px`
Related
Loading source.