#188
End aligned
A scrolling form whose sticky Cancel and Save bar only appears once the Name field has text.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "End aligned" pattern (@codeatlasdev/ui demo #188, layout/sticky-actions) in my app.
Call get_demo({ ids: ["#188"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Edit forms that reveal a save bar only after the user changes something.
Keep these library parts, with the props and tokens the demo uses:
- StickyActions, Button, TextField, Stack from "@codeatlasdev/ui"
Behaviour to keep:
- `let name = $state('')` and `const dirty = $derived(name.length > 0)`
- `<StickyActions show={dirty}>` holds `<Button variant="ghost" onclick={() => (name = '')}>Cancel</Button>` and `<Button variant="filled">Save</Button>`
- `<TextField label="Name" bind:value={name} placeholder="Type to reveal the bar" />` above a `Long content…` filler
- Scroller uses `max-height: 280px` and `overflow-y: auto`
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
- StickyActions
@codeatlasdev/ui - Button
@codeatlasdev/ui - TextField
@codeatlasdev/ui - Stack
@codeatlasdev/ui
How it is built
- `let name = $state('')` and `const dirty = $derived(name.length > 0)`
- `<StickyActions show={dirty}>` holds `<Button variant="ghost" onclick={() => (name = '')}>Cancel</Button>` and `<Button variant="filled">Save</Button>`
- `<TextField label="Name" bind:value={name} placeholder="Type to reveal the bar" />` above a `Long content…` filler
- Scroller uses `max-height: 280px` and `overflow-y: auto`
Related
Loading source.