File tree Expand file tree Collapse file tree 4 files changed +83
-0
lines changed
Expand file tree Collapse file tree 4 files changed +83
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ title : Tile
3+ description : Create complex layouts based on [CSS Grid](https://developer.mozilla.org/en-US/docs/Web/CSS/grid).
4+ category : Structure
5+ keywords :
6+ - layout
7+ status :
8+ value : Alpha
9+ message : This component is in development. There could be breaking changes made to it in a non-major release of Polaris. Please use with caution.
10+ examples :
11+ - fileName : tile-with-spacing.tsx
12+ title : With spacing
13+ - fileName : tile-with-columns.tsx
14+ title : With columns
15+ ---
Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import { Tile , Text } from '@shopify/polaris' ;
3+
4+ import { withPolarisExample } from '../../src/components/PolarisExampleWrapper' ;
5+
6+ const styles = {
7+ background : 'var(--p-surface)' ,
8+ border : 'var(--p-border-base)' ,
9+ borderRadius : 'var(--p-border-radius-2)' ,
10+ padding : 'var(--p-space-4)' ,
11+ } ;
12+
13+ const children = Array . from ( Array ( 8 ) ) . map ( ( ele , index ) => (
14+ < div key = { index } style = { styles } >
15+ < Text as = "h2" variant = "headingMd" >
16+ Sales
17+ </ Text >
18+ < Text as = "p" variant = "bodyMd" >
19+ View a summary of your online store’s sales.
20+ </ Text >
21+ </ div >
22+ ) ) ;
23+
24+ function TileWithColumnsExample ( ) {
25+ return (
26+ < div style = { { width : '500px' } } >
27+ < Tile columns = "4" spacing = "2" >
28+ { children }
29+ </ Tile >
30+ </ div >
31+ ) ;
32+ }
33+
34+ export default withPolarisExample ( TileWithColumnsExample ) ;
Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import { Tile , Text } from '@shopify/polaris' ;
3+
4+ import { withPolarisExample } from '../../src/components/PolarisExampleWrapper' ;
5+
6+ const styles = {
7+ background : 'var(--p-surface)' ,
8+ border : 'var(--p-border-base)' ,
9+ borderRadius : 'var(--p-border-radius-2)' ,
10+ padding : 'var(--p-space-4)' ,
11+ } ;
12+
13+ const children = Array . from ( Array ( 2 ) ) . map ( ( ele , index ) => (
14+ < div key = { index } style = { styles } >
15+ < Text as = "h2" variant = "headingMd" >
16+ Sales
17+ </ Text >
18+ < Text as = "p" variant = "bodyMd" >
19+ View a summary of your online store’s sales.
20+ </ Text >
21+ </ div >
22+ ) ) ;
23+
24+ function TileWithSpacingExample ( ) {
25+ return (
26+ < div style = { { width : '500px' } } >
27+ < Tile columns = "1" spacing = "5" >
28+ { children }
29+ </ Tile >
30+ </ div >
31+ ) ;
32+ }
33+
34+ export default withPolarisExample ( TileWithSpacingExample ) ;
You can’t perform that action at this time.
0 commit comments