About
General five-slot layout primitive for arranging header, start, content, end, and footer regions. Astryx by Meta. Source: https://astryx.atmeta.com/components/Layout
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Astryx Layout to your project and fits it to your theme.
Code
How Astryx Layout is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
'use client';
/* Copyright (c) 2026 Meta Platforms, Inc. See the MIT notice in astryx-layout.tsx. */
import '@/components/ui/astryx-layout-utils/astryx-preview.css';
import '@astryxdesign/theme-neutral/fonts.css';
import {useSyncExternalStore} from 'react';
import {Theme} from '@astryxdesign/core/theme';
import {neutralTheme} from '@astryxdesign/theme-neutral/built';
import {
Layout,
LayoutHeader,
LayoutContent,
LayoutFooter,
LayoutPanel,
HStack,
VStack,
} from '@/components/ui/astryx-layout';
import {Section} from '@astryxdesign/core/Section';
import {Text, Heading} from '@astryxdesign/core/Text';
import {Button} from '@astryxdesign/core/Button';
import {Badge} from '@astryxdesign/core/Badge';
import {List, ListItem} from '@astryxdesign/core/List';
import {useToast} from '@astryxdesign/core/Toast';
function OfficialSample() {
const showToast = useToast();
return (
<Section padding={4} style={{width: '100%', minWidth: 0}}>
<Layout
height="fill"
header={
<LayoutHeader hasDivider>
<HStack gap={2} vAlign="center">
<Heading level={4}>Projects</Heading>
<Badge variant="info" label="3 active" />
</HStack>
</LayoutHeader>
}
start={
<LayoutPanel hasDivider width={140}>
<List>
<ListItem label="Dashboard" isSelected />
<ListItem label="Analytics" />
<ListItem label="Settings" />
</List>
</LayoutPanel>
}
content={
<LayoutContent>
<VStack gap={2}>
<Heading level={5}>Welcome back</Heading>
<Text type="body" color="secondary">
You have 3 active projects and 2 pending reviews.
</Text>
</VStack>
</LayoutContent>
}
footer={
<LayoutFooter hasDivider>
<HStack gap={2} hAlign="end">
<Button
label="New Project"
variant="primary"
onClick={() =>
showToast({body: 'Demo: a new project would be created here'})
}>
New Project
</Button>
</HStack>
</LayoutFooter>
}
/>
</Section>
);
}
function readPreviewMode() {
const {classList} = document.documentElement;
return classList.contains('dark') ? 'dark' : 'light';
}
function subscribeToPreviewMode(callback: () => void) {
const observer = new MutationObserver(callback);
observer.observe(document.documentElement, {attributes: true, attributeFilter: ['class']});
return () => observer.disconnect();
}
export default function Demo() {
const mode = useSyncExternalStore(subscribeToPreviewMode, readPreviewMode, () => 'light' as const);
return (
<Theme theme={neutralTheme} mode={mode}>
<div className="astryx-demo">
<div className="astryx-demo-content" data-centered style={{maxWidth: 483}}>
<OfficialSample />
</div>
</div>
</Theme>
);
}















