.agents/skills/react/references/layout-kit.md
@lobehub/ui provides Flexbox and Center components for creating flexible layouts.
Flexbox is the most commonly used layout component, similar to CSS display: flex.
import { Flexbox } from '@lobehub/ui';
// Default vertical layout
<Flexbox>
<div>Child 1</div>
<div>Child 2</div>
</Flexbox>
// Horizontal layout
<Flexbox horizontal>
<div>Left</div>
<div>Right</div>
</Flexbox>
horizontal: Boolean, set horizontal direction layoutflex: Number or string, controls flex propertygap: Number, spacing between childrenalign: Alignment like 'center', 'flex-start', etc.justify: Main axis alignment like 'space-between', 'center', etc.padding: Padding valuepaddingInline: Horizontal paddingpaddingBlock: Vertical paddingwidth/height: Set dimensions, typically '100%' or specific pixelsstyle: Custom style object// Classic three-column layout
<Flexbox horizontal height={'100%'} width={'100%'}>
<Flexbox
width={260}
style={{
borderRight: `1px solid ${theme.colorBorderSecondary}`,
height: '100%',
overflowY: 'auto',
}}
>
<SidebarContent />
</Flexbox>
<Flexbox flex={1} style={{ height: '100%' }}>
<Flexbox flex={1} padding={24} style={{ overflowY: 'auto' }}>
<MainContent />
</Flexbox>
<Flexbox
style={{
borderTop: `1px solid ${theme.colorBorderSecondary}`,
padding: '16px 24px',
}}
>
<Footer />
</Flexbox>
</Flexbox>
</Flexbox>
Center wraps Flexbox with horizontal and vertical centering.
import { Center } from '@lobehub/ui';
<Center width={'100%'} height={'100%'}>
<Content />
</Center>
// Icon centered
<Center className={styles.icon} flex={'none'} height={40} width={40}>
<Icon icon={icon} size={24} />
</Center>
flex={1} to fill available spacegap instead of margin for spacingoverflow: 'auto' for scrollable contenthorizontal for horizontal layout (default is vertical)useTheme hook for theme-responsive layouts