Example#
Fernlight
Pebblepath
Usage#
Use a grid for columns: a set of cards, a gallery, a form in two columns. Columns follow the width of the grid's container, not the window, so the same grid works in a sidebar and in a full-width section.
colstakes a number or breakpoints by container width, such as{ base: 1, sm: 2, lg: 4 }.minfits as many tracks as a minimum width allows, such asmin="18rem", with no breakpoints at all.gapis a step of the 4 px scale.
Anatomy#
Fernlight
Pebblepath
- GridTracks by container width.
.mk-grid - TrackEach child takes one track.
.mk-grid > :first-child
Volume#
Layout only: identical at every volume.
Quiet
FernlightPebblepathStudio
FernlightPebblepathPress
FernlightPebblepathRave
FernlightPebblepath
Content#
- Items in a grid should be the same kind of thing at about the same length, so rows line up.
Do and don't#
Do
Fernlight
Pebblepath
Mei Tanaka
Don't
Fernlight
Pebblepath
Mei Tanaka
Accessibility#
- Columns follow the nearest container (Container, Section, Main), so a grid in a narrow column stacks even on a wide screen.
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
cols | GridCols | none | |
min | string | none | A track minimum such as "18rem": as many columns as fit. |
gap | SpaceStep | 6 | Default 6 (24 px). |
render | RenderProp | none | |
children | ReactNode | none |
Tokens#
System tokens (5)
Its own properties (8)
--mk-grid-cols--mk-grid-cols-base--mk-grid-cols-lg--mk-grid-cols-md--mk-grid-cols-sm--mk-grid-cols-xl--mk-grid-min--mk-layout-gap
Changelog#
Arrived in 0.1.0.
Sectionwith its plate andArtslot,Plate,VolumeScope,PageHero,SectionHead,Eyebrow,Card,LineCard,InfoPanel,Stack,Cluster,Grid,Container,Main,Ruleand theFittedLineclient fitter;Navbarwith theNavDisclosuremega panels,Footer,FooterMap,BuildStamp,SkipLink,ActionDockandVisitorControls; theTableparts,ComparisonTablewith the one-tier switcher,SpecStrip,Numeral,Stat,StatGroup,StatusChip,BadgeandScoreDial;ProsewithmdxComponents,Quote,CodeBlockwithCopyButton,Figure,ScreenshotFrameandPhoneFrame; and the brand: the three evolved 2 × 2 options inmarkGeometry(a Overprint by default, b Paper seam, c Key block) with the pixel-snappedpxmode and the one-ink seam variant,logoGeometrywith the 1x clear-space frame,Mark,Wordmark,Logo,MaxosMarkandLineBadge. Read the whole entry