Astryx

Astryx Grid

Cards

About

Grid container with fixed or responsive columns; `{minWidth, max}` reflows, a number never does. Astryx by Meta. Source: https://astryx.atmeta.com/components/Grid

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Astryx Grid to your project and fits it to your theme.

Code

How Astryx Grid 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.tsx. */

import '@/components/ui/astryx-grid-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 {Card} from '@astryxdesign/core/Card';
import {Grid} from '@/components/ui/astryx-grid';

function OfficialSample() {
  return (
    <Grid columns={3} gap={2} width={400} maxWidth="100%">
      {Array.from({length: 12}, (_, i) => (
        <Card key={i}>Item {i + 1}</Card>
      ))}
    </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>
  );
}

Dependencies

More by Astryx

View all
  • Astryx Banner

    Astryx Banner

    61
  • Astryx Avatar

    Astryx Avatar

    34
  • Astryx Aspect Ratio

    Astryx Aspect Ratio

    32
  • Astryx Badge

    Astryx Badge

    30
  • Astryx Button Group

    Astryx Button Group

    29
  • Astryx Chat Composer Drawer

    Astryx Chat Composer Drawer

    28
  • Astryx Toggle Button

    Astryx Toggle Button

    17
  • Astryx Chat Tokenized Text

    Astryx Chat Tokenized Text

    12

More in Cards

View all
  • Course Design Cards

    Course Design Cards

    1.3K
  • Stats cards with links

    Stats cards with links

    103
  • Admin Dashboard Cards

    Admin Dashboard Cards

    32
  • Card

    Card

    2
  • Statistics Card 7

    Statistics Card 7

    341
  • Astryx Clickable Card

    Astryx Clickable Card

    2
  • Photo Deck

    Photo Deck

    73
  • Interactive Tech Stack Bento Grid with Hover Effects

    Interactive Tech Stack Bento Grid with Hover Effects

    766