Skip to content

Commit bf1f512

Browse files
author
Kaelan Khiatani
committed
docs(tile): Adds content to tile component
1 parent fe7fae9 commit bf1f512

File tree

1 file changed

+19
-6
lines changed
  • packages/react-core/src/components/Tile/examples

1 file changed

+19
-6
lines changed
Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: Tile
33
section: components
4-
cssPrefix: pf-v5-c-tile
4+
cssPrefix: pf-c-tile
55
propComponents: ['Tile']
66
---
77

@@ -10,25 +10,38 @@ import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
1010

1111
## Examples
1212

13+
Keyboard interaction patterns and a11y is implemented in the Tile demos, located in the [Demo section](/components/tile/react-demos).
14+
1315
### Basic tile
1416
Basic tiles can appear in one of three states: a default state, selected state, and a disabled state. To change the state of a tile, use the properties ‘isSelected’ and ‘isDisabled’.
17+
```ts file="./TileBasic.tsx"
18+
```
1519

1620
### With subtext
1721
Tile subtext can provide users with additional context. To add subtext, pass a short description to the `<Tile>` component.
18-
19-
### With long subtext
20-
To provide users with a large amount of context, subtext can be elongated to wrap around to the next line. To format a long subtext, you can pass the component `Flex` into `<Tile>`.
21-
22-
You can also change the type of `Flex` you can use so that the line breaks in the subtext fits your needs. You can do this by changing the default flex. The standard is `default: “flex_1”`, and changing the number in the default will also change where the sentence breaks.
22+
```ts file="./TileWithSubtext.tsx"
23+
```
2324

2425
### With icon
2526
Icons can provide a visual cue that helps users understand what the tile is being used for. To add an icon, use the `icon` property.
27+
```ts file="./TileWithIcon.tsx"
28+
```
2629

2730
### With stacked icon
2831
You can further customize a tile’s appearance by placing an icon above the title. To stack your icon on top of a tile’s title, use the `isStacked`property.
32+
```ts file="./TileStacked.tsx"
33+
```
2934

3035
### With large icons
3136
You can make your icons larger to help catch a user’s attention. To increase the size of an icon, use the `isDisplayLarge` property..
3237

3338
Be aware that `isDisplayLarge` can only be used when `isStacked` is also applied.
39+
```ts file="./TileStackedWithLargeIcons.tsx"
40+
```
3441

42+
### With long subtext
43+
To provide users with a large amount of context, subtext can be elongated to wrap around to the next line. To format a long subtext, you can pass the component `Flex` into `<Tile>`.
44+
45+
You can also change the type of `Flex` you can use so that the line breaks in the subtext fits your needs. You can do this by changing the default flex. The standard is `default: “flex_1”`, and changing the number in the default will also change where the sentence breaks.
46+
```ts file="./TileWithExtraContent.tsx"
47+
```

0 commit comments

Comments
 (0)