@@ -14,24 +14,31 @@ import { FlexGrid } from './index'
14
14
15
15
## Description
16
16
17
- FlexGrid component created with [ ` FlexBox ` ] ( #/flex-box ) .
17
+ Grid component based on [ ` FlexBox ` ] ( #/flex-box ) .
18
18
19
- - Default to ` 12 ` columns. Must be defined in ` theme.grid `
20
- - Item size can be set with ` col ` or ` size ` prop in ` FlexGrid.Item ` component
21
- - Space between items can be set with ` space ` , ` spacex ` and ` spacey ` props
19
+ - Default to ` 12 ` columns. Can be defined in ` theme.grid `
20
+ - Item size conrolled with ` col ` or ` size ` prop in ` FlexGrid.Item ` component
21
+ - Space between items conrolled with ` space ` , ` spacex ` and ` spacey ` props
22
22
23
- Components:
23
+ ### Components:
24
24
25
- - ` FlexGrid ` — Container component. Control space between items with props:
26
- + Possible values can be set in ` theme.space ` , see [ space docs] ( https://github.com/exah/pss/blob/master/docs/api.md#space )
27
- + ` space ` — setting horizontal and vertical space
28
- + ` spacex ` — setting horizontal space
29
- + ` spacey ` — setting vertical space
30
- + ` spaceContent ` — apply space to ` FlexGrid.Content ` instead of ` FlexGrid.Item `
31
- - ` FlexGrid.Item ` — Item / column component, size can be set with props:
32
- + ` col ` — Number in range ` 1...theme.grid ` , result is precentage size. (` col / theme.grid ` , i.e. ` 3 / 12 = 25% ` )
33
- + ` size ` — Number from ` 0...1 ` , result is percentage (` 0.5 ` is ` 50% ` )
34
- - ` FlexGrid.Content ` — Content wrapper same as [ ` Box ` ] ( #/box )
25
+
26
+ #### ` FlexGrid ` — Container component. Control space between items with props:
27
+
28
+ - Possible values in ` theme.space ` . See [ space docs] ( https://github.com/exah/pss/blob/master/docs/api.md#space )
29
+ - ` space ` — horizontal and vertical space
30
+ - ` spacex ` — horizontal space
31
+ - ` spacey ` — vertical space
32
+ - ` spaceContent ` — apply space to ` FlexGrid.Content ` instead of ` FlexGrid.Item `
33
+
34
+ #### ` FlexGrid.Item ` — Item / column component, size can be set with props:
35
+
36
+ - ` col ` — Number in range ` 1...theme.grid `
37
+ - ` size ` — Number in range ` 0...1 ` , result is percentage (` 0.5 ` is ` 50% ` )
38
+ - ` offset ` — Number in range ` 1...theme.grid ` — move item by number of columns
39
+
40
+
41
+ #### ` FlexGrid.Content ` — Content wrapper same as [ ` Box ` ] ( #/box )
35
42
36
43
## Usage
37
44
@@ -150,7 +157,34 @@ import { FlexGrid } from 'pss-components'
150
157
</ThemeProvider >
151
158
</Playground >
152
159
153
- ### Dynamic 'size' prop
160
+ ### Offset items
161
+
162
+ <Playground >
163
+ <FlexGrid space = { 1 } >
164
+ <FlexGrid.Item col = { 3 } mgr = ' 75%' >
165
+ <FlexGrid.Content bg = ' gray.0' >
166
+ 3
167
+ </FlexGrid.Content >
168
+ </FlexGrid.Item >
169
+ <FlexGrid.Item col = { 3 } offset = { 3 } >
170
+ <FlexGrid.Content bg = ' gray.0' >
171
+ 3
172
+ </FlexGrid.Content >
173
+ </FlexGrid.Item >
174
+ <FlexGrid.Item col = { 3 } offset = { 6 } >
175
+ <FlexGrid.Content bg = ' gray.0' >
176
+ 3
177
+ </FlexGrid.Content >
178
+ </FlexGrid.Item >
179
+ <FlexGrid.Item col = { 3 } offset = { 9 } >
180
+ <FlexGrid.Content bg = ' gray.0' >
181
+ 3
182
+ </FlexGrid.Content >
183
+ </FlexGrid.Item >
184
+ </FlexGrid >
185
+ </Playground >
186
+
187
+ ### Dynamic size
154
188
155
189
<Playground >
156
190
<FlexGrid space = { 1 } >
0 commit comments