Skip to content

Commit 6b76bf5

Browse files
committed
chore(card): added header wrap example
1 parent 5485f4b commit 6b76bf5

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

packages/react-core/src/components/Card/examples/Card.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ Images can also be placed in the card header without a `<CardTitle>`.
8989

9090
```
9191

92+
### Card with header that wraps
93+
```ts file='./CardHeaderWraps.tsx'
94+
```
95+
9296
### With HTML heading element
9397

9498
You may use the `component` property to place the card's title within an HTML heading element.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { Card, CardBody, CardHeader, Button, CardTitle, Flex, FlexItem } from '@patternfly/react-core';
2+
3+
export const CardBasic: React.FunctionComponent = () => (
4+
<Card ouiaId="BasicCard">
5+
<CardHeader hasWrap>
6+
{' '}
7+
<Flex columnGap={{ default: 'columnGapXl' }} justifyContent={{ default: 'justifyContentSpaceBetween' }}>
8+
<FlexItem>
9+
<CardTitle>This is a longer card title that takes up more space</CardTitle>
10+
</FlexItem>
11+
<FlexItem>
12+
<Button variant="primary" ouiaId="Primary">
13+
Primary action
14+
</Button>
15+
<Button variant="secondary" ouiaId="Secondary">
16+
Secondary action
17+
</Button>
18+
<Button variant="tertiary" ouiaId="Tertiary">
19+
Tertiary action
20+
</Button>
21+
</FlexItem>
22+
</Flex>
23+
</CardHeader>
24+
<CardBody>This is the card body</CardBody>
25+
</Card>
26+
);

0 commit comments

Comments
 (0)