Work in Progress
This library is still a work in progress and things will likely change.
Included with Starter Kit
Get our How to eat donuts course for just £5.99!
This component is available with our Astro Starter Kit.
The Flow component can be used to manage the spacing between elements. By default, it’s a vertical flow but you can also manage horizontal flow content.
Import the component where you need to use it:
---
import Flow from '@components/Flow.astro';
---
<Flow>
<h1>Title</h1>
<p>Content</p>
</Flow>
You can control the space between items using the space prop, like this:
<Flow space="sm"></Flow>
Valid space values are: none, xs, sm, md, lg, xl, 2xl, 3xl, 4xl and 5xl.
You can also control the direction of the flow using the direction prop, like this:
<Flow space="lg" direction="horizontal">
<p>This content flows horizontally.</p>
<p>Lovely.</p>
</Flow>
By default, horizontal content will not wrap. You can enable wrapping using the wrap prop, like this:
<Flow space="lg" direction="horizontal" wrap>
<p>This content flows horizontally.</p>
<p>It will wrap if the space available gets too small.</p>
</Flow>
By default, the Flow component will render a <div> element. You can change this using the as prop, like this:
<Flow as="article"></Flow>
We use cookies to provide the best experience.