Loaf
Loaf gives the app shell its content area and scrolling element. it renders #loaf-wrapper around #loaf, then your required children snippet inside.
the preview has its own document and reuses the site shell. use the complete example below in your app.
usage
<script>
import { Basket, Loaf, PageContainer } from '@ciabi/loafkit-ui';
</script>
<Basket>
<Loaf>
<PageContainer pageId="notes" maxWidth="50rem">
<h1>notes</h1>
<p>keep the note editor inside the content scroller.</p>
</PageContainer>
</Loaf>
</Basket>composition
- Loaf
- PageContainer (or page content)
work with the existing scroller
use one Loaf inside one Basket. keep Navbar as Loaf’s sibling so the shell can reserve the right space. Loaf doesn’t take class, style or an element binding; wrap your own content when it needs layout styles.
#loaf is the element to pass to a scroll-aware widget such as OnThisPage. look it up after mounting, when the element exists. scrolling the document won’t move content that is actually scrolling inside Loaf.
Loaf isn’t a main landmark and doesn’t constrain reading width. add PageContainer when the content needs both. use normal containers for subpanels that shouldn’t become another full app shell.
API reference
Loaf
children-
the content of the app’s main scroller.