@@ -27,10 +27,7 @@ import { Grid } from '@react-ui-org/react-ui';
2727And use it:
2828
2929<Playground >
30- <Grid columns = " 1fr 1fr 1fr" >
31- <Placeholder bordered >Grid item</Placeholder >
32- <Placeholder bordered >Grid item</Placeholder >
33- <Placeholder bordered >Grid item</Placeholder >
30+ <Grid >
3431 <Placeholder bordered >Grid item</Placeholder >
3532 <Placeholder bordered >Grid item</Placeholder >
3633 <Placeholder bordered >Grid item</Placeholder >
@@ -41,7 +38,7 @@ See [API](#api) for all available options.
4138
4239## General Guidelines
4340
44- - This component implements native [ CSS grid layout] [ grid-layout ] , the right CSS
41+ - This component implements native [ CSS grid layout] [ grid-layout ] , a powerful
4542 tool for two-dimensional layouts. You may use any value accepted by
4643 [ grid-template-columns] , [ grid-template-rows] , [ grid-column-gap] ,
4744 [ grid-row-gap] , [ grid-auto-flow] , [ align-content] , [ align-items] ,
@@ -53,20 +50,22 @@ See [API](#api) for all available options.
5350 markup** like GridItem or Cell is necessary for your items. But it's there
5451 when you really need it—see [ Advanced Layouts] ( #advanced-layouts ) .
5552
53+ - For forms, use rather the [ FormLayout] ( /components/form-layout ) component
54+ which is designed specifically for that purpose.
55+
5656- The Grid component is so powerful that it enables you to build even very
5757 advanced layouts ** without** having to write ** a single line of custom CSS.**
5858 See [ Advanced Layouts] ( #advanced-layouts ) for more.
5959
60- 👉 The default layout has one column, auto-sized rows and gaps of
61- [ size 4] ( /foundation/spacing ) . Defaults for all Grid API options can be
62- [ customized] ( /customize/theming/overview ) with CSS custom properties.
60+ 👉 Vertical margin of items inside Grid is reset to zero.
6361
64- ## Columns and Rows
62+ ## Columns
6563
66- Use ` columns ` and ` rows ` to specify your grid layout.
64+ Unless the defaults are modified, stack is the default outcome of Grid. Use the
65+ ` columns ` option to organize your items into grid.
6766
6867<Playground >
69- <Grid columns = " 1fr 2fr " rows = " auto 200px auto " >
68+ <Grid columns = " 1fr 1fr 1fr " >
7069 <Placeholder bordered >Grid item</Placeholder >
7170 <Placeholder bordered >Grid item</Placeholder >
7271 <Placeholder bordered >Grid item</Placeholder >
@@ -106,6 +105,21 @@ responsive layouts. Resize the playground to see it in action.
106105👉 If you need your items to have ** equal height** even with content of varying
107106length, it may be necessary to set ` height: 100% ` on them.
108107
108+ ## Rows
109+
110+ Use ` columns ` and ` rows ` to specify a more complicated grid layout.
111+
112+ <Playground >
113+ <Grid columns = " 1fr 2fr" rows = " auto 200px auto" >
114+ <Placeholder bordered >Grid item</Placeholder >
115+ <Placeholder bordered >Grid item</Placeholder >
116+ <Placeholder bordered >Grid item</Placeholder >
117+ <Placeholder bordered >Grid item</Placeholder >
118+ <Placeholder bordered >Grid item</Placeholder >
119+ <Placeholder bordered >Grid item</Placeholder >
120+ </Grid >
121+ </Playground >
122+
109123## Gaps
110124
111125Both column and row gaps can be customized.
@@ -141,6 +155,25 @@ Individual items and the entire grid content can be aligned and along both axes.
141155 </Grid >
142156</Playground >
143157
158+ ## Custom HTML Tag
159+
160+ To render as list for example, just change the output ` tag ` to ` ul ` or ` ol ` and
161+ wrap your items with ` <li> ` .
162+
163+ <Playground >
164+ <Grid tag = " ul" >
165+ <li >
166+ <Placeholder bordered >List item</Placeholder >
167+ </li >
168+ <li >
169+ <Placeholder bordered >List item</Placeholder >
170+ </li >
171+ <li >
172+ <Placeholder bordered >List item</Placeholder >
173+ </li >
174+ </Grid >
175+ </Playground >
176+
144177## Media Queries
145178
146179If you need to build more complicated layouts, you have full control over the
@@ -253,7 +286,7 @@ Wrapper for content that should span multiple rows or columns.
253286[ grid-column-gap ] : https://developer.mozilla.org/en-US/docs/Web/CSS/column-gap
254287[ grid-row-gap ] : https://developer.mozilla.org/en-US/docs/Web/CSS/row-gap
255288[ grid-auto-flow ] : https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-flow
256- [ aling -content] : https://developer.mozilla.org/en-US/docs/Web/CSS/align-content
289+ [ align -content] : https://developer.mozilla.org/en-US/docs/Web/CSS/align-content
257290[ align-items ] : https://developer.mozilla.org/en-US/docs/Web/CSS/align-items
258291[ justify-content ] : https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content
259292[ justify-items ] : https://developer.mozilla.org/en-US/docs/Web/CSS/justify-items
0 commit comments