Transcript
00:00 So we’ve got a groovy little shell for Kanban board. We are going to bring in some primitive components here. We’ve got section, which is like the highest level component you can have in your application. As far as I know, um, and it’s really setting like full screen things.
00:17 And then we’ve got layout layout header and layout content. Um, this allows us to lay out our site with like a, maybe like a fixed header, which we’re going to do, or a fixed footer scrollable content area, things of that nature.
00:31 And then we’ve got H stack. So there’s H stack and V stack, and they are really just ways to simplify CSS grid. And they’re actually a lot more close to a flex. Um, so H stack is horizontal and V stack is a vertical. And then they just have different alignment properties. We’ll take a look at them in a second that save you some typing. You don’t have to do flex and flex direction and justify content and align items and things of that nature.
01:00 So we’re going to kill what we have. And we’re going to drop in this giant section here, and we’ll step through it really quick. Uh, on our height, we’ve got 100 DVH. So it’s dynamic V H. Then we’ve got our layout with a height of fill and then our header and our content are both render props. Uh, I believe they can be JSX children, but this is the way it was in the documentation. So this is the way I’m doing it. Uh, so we’ve got our layout header. It’s got an H stack and a heading with a level of two and then type script again, with some of these, um, design tokens that we’ll talk about later.
01:35 And then we’ve got our content again, this is going to be like a scrollable area. So if we look over here, uh, let me zoom this out a bit. We can see, we can scroll left and right. And if I take this, uh, card actually all the cards and I give it a height of say 900 pixels, we can see, we can scroll up and down. Uh, so we’ve got a fixed header and a scrollable, uh, content area. That’s going to be this layout content area. So the header is fixed automatically inside of this layout and then the layout content is scrollable.
02:14 And then we’ve got some standard, uh, uh, typography type elements that we’ve used here before. There’s elements like, uh, sorry, properties like gap, uh, V align, H align, things of that nature where you are literally saying H align between instead of justify content, you know, space between or V align center, instead of align items center. So all of it translates back to, uh, flex properties. Uh, so, so there you go. That’s nice and simple.
02:42 And then all I’m doing here is mapping over a fake set of tickets, which is where, uh, or a fake set of columns, which is where all these columns are coming from from. So there you go. That’s a really quick look at using some of the layout and spatial components available to you in Astryx.
Layout management in Astryx relies on composable flex primitives that eliminate manual layout CSS. In this lesson, we turn the stub from lesson 1 into the real board shell — an app-frame with a fixed header and a scrollable body holding a row of placeholder columns.
Files this lesson: src/app/components/KanbanBoard.tsx (rewritten). page.tsx stays untouched.
Spatial Stacks: HStack and VStack
Rather than applying display: flex and flex-direction across custom classes, Astryx provides HStack (horizontal stack) and VStack (vertical stack).
Key Props
gap: Numeric scale value representing spacing (gap={1}is--spacing-1,gap={4}is--spacing-4).hAlign: Horizontal alignment ("start","center","end","between").vAlign: Vertical alignment ("start","center","end","between").wrap: Flex wrapping mode ("wrap","nowrap").
Application Shell Containers
Astryx provides Section and Layout for establishing top-level viewport bounds and scrollable regions.
Section
The <Section> component defines top-level section boundaries. For full-screen tools like our Kanban board, set height="100dvh" so the app always fills the viewport:
<Section height="100dvh"> {/* Application content */}</Section>Layout, LayoutHeader, and LayoutContent
Layout partitions an application into a fixed header and a scrollable content body:
LayoutHeader: The top bar. AddhasDividerto draw a separator under it, andpaddingto control inset spacing.LayoutContent: The scrollable body. Itsrefis forwarded to the underlying DOM node — we will use that in lesson 11 for drag-and-drop hit-testing.Layouttakesheaderandcontentas render props (or JSX children).
Building the Shell: KanbanBoard.tsx
Rewrite src/app/components/KanbanBoard.tsx as a full app frame: a header with the board title, and a content area holding four placeholder columns in a horizontal strip:
'use client';
import { Section } from '@astryxdesign/core/Section';import { Layout, LayoutHeader, LayoutContent, HStack,} from '@astryxdesign/core/Layout';import { Heading, Text } from '@astryxdesign/core/Text';import { Card } from '@astryxdesign/core/Card';
export default function KanbanBoard() { return ( <Card padding={4}> <Heading level={2}>Sprint Board</Heading> <Text color="secondary"> The Kanban board is under construction — we will build it together over the coming lessons. </Text> </Card> <Section height="100dvh"> <Layout height="fill" header={ <LayoutHeader hasDivider padding={4}> <HStack hAlign="between" vAlign="center"> <Heading level={3}>Sprint Board</Heading> <Text type="supporting" color="secondary"> Layout shell — real columns arrive in lesson 6 </Text> </HStack> </LayoutHeader> } content={ <LayoutContent padding={4}> <HStack gap={4}> {[0, 1, 2, 3].map(i => ( <Card key={i} variant="muted" padding={3} width={300} style={{ flexShrink: 0 }} > <Heading level={4}>Column {i + 1}</Heading> <Text type="supporting" color="secondary"> Placeholder — data arrives in lesson 6. </Text> </Card> ))} </HStack> </LayoutContent> } /> </Section> );}Read the structure top-down:
Section height="100dvh"locks the app to the viewport height.Layout height="fill"makes the frame fill that section.LayoutHeaderholds the title bar;hasDividerdraws the separator line.LayoutContent padding={4}is the scrollable body — when real columns overflow, this is what scrolls.- Inside, an
HStack gap={4}lays the four placeholder columns side by side. Each is a mutedCardat a fixedwidth={300}withflexShrink: 0so columns never squish. hAlign="between"on the header stack pushes the title left and the supporting text right.
See It in Action
Run npm run dev and open http://localhost:3000. You now have a full-height application frame: a fixed header with a divider, and a scrollable content area with four muted placeholder columns. Resize the window — the header stays put and the columns are side by side. If the strip overflows, the content body scrolls.
What You Built
- The board’s permanent frame:
Section→Layout→LayoutHeader+LayoutContent. - A
HStackcolumn strip with Astryx’s gap scale and alignment props. - The placeholder columns we will style in lesson 4 and fill with real data in lesson 6.
In the next lesson, we will localize the board and add a language switcher.