About
Grid item that spans multiple columns or rows. Astryx by Meta. Source: https://astryx.atmeta.com/components/GridSpan
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Astryx Grid Span to your project and fits it to your theme.
Code
How Astryx Grid Span 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-grid-span.tsx. */
import '@/components/ui/astryx-grid-span-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 {Grid, GridSpan} from '@/components/ui/astryx-grid-span';
import {Card} from '@astryxdesign/core/Card';
import {Text} from '@astryxdesign/core/Text';
function OfficialSample() {
return (
<Grid columns={4} gap={3} width={400} maxWidth="100%">
<GridSpan columns={3}>
<Card height={80}>
<Text type="body" color="secondary">
Spans 3 columns
</Text>
</Card>
</GridSpan>
<Card height={80}>
<Text type="body" color="secondary">
1 col
</Text>
</Card>
<GridSpan rows={2}>
<Card>
<Text type="body" color="secondary">
1 col
</Text>
</Card>
</GridSpan>
<GridSpan columns={3}>
<Card height={80}>
<Text type="body" color="secondary">
Full-width row
</Text>
</Card>
</GridSpan>
<Card height={80}>
<Text type="body" color="secondary">
1 col
</Text>
</Card>
<GridSpan columns={2}>
<Card height={80}>
<Text type="body" color="secondary">
Spans 2 columns
</Text>
</Card>
</GridSpan>
</Grid>
);
}
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: 400}}>
<OfficialSample />
</div>
</div>
</Theme>
);
}















