Skip to content

Commit c9575cb

Browse files
committed
[Tile] Add alpha page with examples
1 parent b183971 commit c9575cb

File tree

4 files changed

+83
-0
lines changed

4 files changed

+83
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
---
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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);
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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);
25.3 KB
Loading

0 commit comments

Comments
 (0)