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
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
| Prop | Description | Type | Options | Default |
|---|---|---|---|---|
| direction | Arrangement direction (auto vertical with Aside) | 'horizontal' | 'vertical' | — | 'horizontal' |
| sx | Layout shorthand | SxProps | — | — |
LhLayoutAside Props
| Prop | Description | Type | Options | Default |
|---|---|---|---|---|
| width | Aside width | number | string | — | — |
| ariaLabel | Accessible name (landmark naming) | string | — | — |
| sx | Layout shorthand | SxProps | — | — |
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'