Skip to main content

Layout

Page skeleton: LhLayout plus LhLayoutHeader / LhLayoutAside / LhLayoutMain / LhLayoutFooter. All use semantic tags (header / aside / main / footer), so landmark roles come for free.

Basic usage​

Top / content / bottom
Header
Content
Footer
Horizontal
Horizontal
Vertical
Vertical
Header
Content
import { LhLayout, LhLayoutHeader, LhLayoutMain, LhLayoutFooter } from '@lh-ui/react'

export default function Demo() {
return (
<LhLayout direction="vertical">
<LhLayoutHeader>Header</LhLayoutHeader>
<LhLayoutMain>Content</LhLayoutMain>
<LhLayoutFooter>Footer</LhLayoutFooter>
</LhLayout>
)
}

Aside layout​

direction explicitly controls how children are laid out: horizontal side by side (default), or vertical stacked. When an LhLayoutAside is present, the parent switches to vertical automatically (header on top, aside and content side by side).

import {
LhLayout,
LhLayoutHeader,
LhLayoutAside,
LhLayoutMain,
LhLayoutFooter,
} from '@lh-ui/react'

export default function Demo() {
return (
<LhLayout direction="vertical">
<LhLayoutHeader>Header</LhLayoutHeader>
<LhLayout>
<LhLayoutAside width={140} ariaLabel="Side navigation">
Aside
</LhLayoutAside>
<LhLayoutMain>Content</LhLayoutMain>
</LhLayout>
<LhLayoutFooter>Footer</LhLayoutFooter>
</LhLayout>
)
}

LhLayout Props​

PropDescriptionTypeOptionsDefault
directionArrangement direction (auto vertical with Aside)'horizontal' | 'vertical'—'horizontal'
sxLayout shorthandSxProps——

LhLayoutAside Props​

PropDescriptionTypeOptionsDefault
widthAside widthnumber | string——
ariaLabelAccessible name (landmark naming)string——
sxLayout shorthandSxProps——
Accessibility

Semantic tags map directly to landmark roles (header / main / footer / aside) with no extra ARIA; when using multiple asides, distinguish them with ariaLabel (e.g. "Side navigation", "Related links").

Styles​

import '@lh-ui/react/style/layout'