Zum Inhalt springen

Grid Component

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

The Grid component provides a responsive grid layout system that automatically adapts to different screen sizes, making it perfect for organizing cards, content blocks, or any other elements.

Prop

Type

Required

Default

Description

columns

number

No

2

Number of columns to display on larger screens

  • Responsive Design - Automatically adjusts from multi-column to single column on mobile

  • Flexible Columns - Supports 1-6 columns on larger screens

  • Automatic Spacing - Consistent gaps between grid items

  • Slot Content - Accepts any content as children

  • Mobile-First - Single column on small screens, customizable on larger screens

The Grid component automatically adapts to different screen sizes:

  • Mobile (< 768px) - Always displays single column regardless of columns prop

  • Tablet & Desktop (≥ 768px) - Uses the specified number of columns

You can specify any number of columns, but common configurations are:

  • columns=\{1\} - Single column (useful for overriding default)

  • columns=\{2\} - Two columns (default)

  • columns=\{3\} - Three columns (great for feature lists)

  • columns=\{4\} - Four columns (compact layouts)

  • columns=\{5\} - Five columns (for many small items)

  • columns=\{6\} - Six columns (maximum recommended)

The component uses CSS custom properties for flexible column management:

  • Uses CSS Grid for layout

  • Automatic gap spacing (1rem)

  • Responsive breakpoints

  • Compatible with Starlight’s design system

  • Use 2-3 columns for most content layouts

  • Ensure grid items have similar content lengths for best visual balance

  • Test on mobile devices to ensure single-column layout works well

  • Consider using fewer columns for content-heavy items

  • Group related items within the same grid for better organization

Still Reading Docs? Start Doing!

Unlock the full potential of Feedigy's power to streamline and automate your content marketing efforts!