A card component that can be used to display content in a box.
import { card } from '@backstage/ui';
<Card>
<CardHeader>Header</CardHeader>
<CardBody>Body</CardBody>
<CardFooter>Footer</CardFooter>
</Card>
A card component that can be used to display content in a box.
Prop | Type | Default | Responsive |
---|---|---|---|
className | string | - | No |
style | CSSProperties | - | No |
To display a header in a card, use the CardHeader
component. This will be fixed at the top of the card.
Prop | Type | Default | Responsive |
---|---|---|---|
className | string | - | No |
style | CSSProperties | - | No |
To display content in a card, use the CardBody
component. This will automatically fill the card.
Prop | Type | Default | Responsive |
---|---|---|---|
className | string | - | No |
style | CSSProperties | - | No |
To display a footer in a card, use the CardFooter
component. This will be fixed at the bottom of the card.
Prop | Type | Default | Responsive |
---|---|---|---|
className | string | - | No |
style | CSSProperties | - | No |
Here's a view when card has a long body.
<Card style={{ width: '300px', height: '200px' }}>
<CardHeader>
<Text>Header</Text>
</CardHeader>
<CardBody>
<Text>
This is the first paragraph of a long body text that demonstrates how
the Card component handles extensive content. The card should adjust
accordingly to display all the text properly while maintaining its
structure.
</Text>
<Text>
Here's a second paragraph that adds more content to our card body.
Having multiple paragraphs helps to visualize how spacing works within
the card component.
</Text>
<Text>
This third paragraph continues to add more text to ensure we have a
proper demonstration of a card with significant content. This makes it
easier to test scrolling behavior and overall layout when content
exceeds the initial view.
</Text>
</CardBody>
<CardFooter>
<Text>Footer</Text>
</CardFooter>
</Card>
Here's a view when card has a list.
<Card style={{ width: '300px', height: '200px' }}>
<CardHeader>
<Text>Header</Text>
</CardHeader>
<CardBody>
<ListRow>Hello world</ListRow>
<ListRow>Hello world</ListRow>
<ListRow>Hello world</ListRow>
<ListRow>Hello world</ListRow>
...
</CardBody>
<CardFooter>
<Text>Footer</Text>
</CardFooter>
</Card>
Our theming system is based on a mix between CSS classes, CSS variables and data attributes. If you want to customise this component, you can use one of these class names below.
bui-Card
bui-CardHeader
bui-CardBody
bui-CardFooter
0.6.0
- New Card
component. #30467