Layout
StickyActions
A form action bar pinned to the bottom of a scrolling container, with glass, safe-area and virtual keyboard support.
<script>
import { StickyActions, Button } from "@codeatlasdev/ui";
</script>
<StickyActions show={dirty}>
<Button variant="ghost">Cancel</Button>
<Button variant="filled">Save</Button>
</StickyActions>
Place it as the last child of the element that scrolls. On screens narrower than 900px it sticks to the bottom edge with a glass background, respects the home-indicator inset (--ca-safe-bottom) and rises with the virtual keyboard. From 900px up it becomes a plain inline row without chrome.
End aligned
Buttons sit on the right. The bar only renders while the form is dirty (show).
Long content…
Code
Stretch
On touch screens the primary button fills the width and the ghost button stays compact.
Long content…
Code
Props
| Prop | Type | Default | Description |
|---|---|---|---|
children | Snippet | – | The buttons of the bar. |
align | 'end' | 'stretch' | 'end' | 'end' packs the buttons to the right. 'stretch' makes the buttons fill the width on touch screens. |
show | boolean | true | Renders the bar only while there is something to confirm. |
class | string | '' | Extra class names. |