Card

Card

import Card, { CardSection } from "@kiwicom/orbit-components/lib/Card";
<Card>
<CardSection>Hello World!</CardSection>
</Card>

Props

NameTypeDefaultDescription
actionsReact.NodeOptional prop for Action components in header of Card.
childrenReact.NodeThe content of the Card. You can use only CardSection.
dataTeststringOptional prop for testing purposes.
idstringSet id for Card.
descriptionReact.NodeThe description of the Card.
headerReact.NodeThe header of the Card. Useful when you need a different layout than the combination of e.g. title and description.
loadingbooleanIf true, a loading animation will be rendered.
onClose() => void \| PromiseCallback that is triggered when Card is closing.
titleReact.NodeThe title of the Card.
titleAsenum"div"The element used for the root node of the title of Card. It does not impact the visual style of the title.
marginstring \| number \| ObjectUtility prop to set margin.
labelClosestringCloseProperty for passing translation string to close Button.

CardSection

import Card, { CardSection } from "@kiwicom/orbit-components/lib/Card";

Usage:

<Card>
<CardSection>Hello World!</CardSection>
</Card>

Props

NameTypeDefaultDescription
actionsReact.NodeActions which will be rendered on the right side. If used with expandable or onClick, the rendered elements should not be interactive but can be used to represent states.
childrenReact.NodeThe content of the CardSection.
dataTeststringOptional prop for testing purposes.
descriptionReact.NodeThe description of the CardSection.
expandablebooleanfalseIf true, the CardSection will be expandable.
expandedbooleanCan only be used if expandable is true. If you pass a value, the CardSection component will be controlled and you will have to manage the state via onExpand or onClose. If you leave it empty, the component will be uncontrolled.
headerReact.NodeThe header of the CardSection. Useful when you need a different layout than the combination of e.g. title and description properties.
initialExpandedbooleanfalseInitial state of expandable CardSection when it mounts in uncontrolled variant. Can only be used if expandable is true and expanded is not defined.
noSeparatorBooleanOptional prop to not render the Separator between header and children.
onClickevent => void \| PromiseFunction for handling the onClick event.
onClose() => void \| PromiseCallback that is triggered when section is closing. Can be used in both controlled or uncontrolled version.
onExpand() => void \| PromiseCallback that is triggered when section is expanding. Can be used in both controlled or uncontrolled version.
titleReact.NodeThe title of the CardSection.
titleAsenum"div"The element used for the root node of the title of CardSection.

enum

titleAs
"h1"
"h2"
"h3"
"h4"
"h5"
"h6"
"div"