#095
Footer and swipeToDismiss
A bottom sheet titled Sessions with a footer button, opened with swipe to dismiss on or off.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Footer and swipeToDismiss" pattern (@codeatlasdev/ui demo #095, feedback/sheet) in my app.
Call get_demo({ ids: ["#095"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Mobile sheets with a pinned primary action that sometimes must not be dismissed by dragging.
Keep these library parts, with the props and tokens the demo uses:
- Sheet, Button, Stack from "@codeatlasdev/ui"
Behaviour to keep:
- `<Sheet bind:open title="Sessions" swipeToDismiss={swipe} onclose={() => (open = false)}>`
- Two triggers set `swipe = true` and `swipe = false` before `open = true`: Sheet with footer and Swipe disabled
- Body is `<Stack gap="2">` with a paragraph whose text depends on `swipe`
- `{#snippet footer()}` holds `<Button variant="filled"` New session with a `<Plus size={15} />` icon
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
- `<Sheet bind:open title="Sessions" swipeToDismiss={swipe} onclose={() => (open = false)}>`
- Two triggers set `swipe = true` and `swipe = false` before `open = true`: Sheet with footer and Swipe disabled
- Body is `<Stack gap="2">` with a paragraph whose text depends on `swipe`
- `{#snippet footer()}` holds `<Button variant="filled"` New session with a `<Plus size={15} />` icon
Related
Loading source.