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 different layout then combination of eg title and description
loadingbooleanIf true Loading will be rendered
onClose() => void \| PromiseCallback that is triggered when Card is closing
titleReact.NodeThe title of the Card
titleAsenum"h2"The element used for the root node of the title of Card.
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
childrenReact.NodeThe content of the CardSection.
dataTeststringOptional prop for testing purposes.
descriptionReact.NodeThe description of the CardSection
expandablebooleanfalseIf true, the CardSection will be expandable.
expandedbooleanIf you pass either true or false the CardSection component will controlled component and you will have to manage the state via onExpand or onClose. Can only be used if expandable is true.
headerReact.NodeThe header of the CardSection. Useful when you need different layout than 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.
noSeparatorBooleanOptional prop to turn off Separator between header and children
onClickevent => void \| PromiseFunction for handling the onClick event.
onClose() => void \| PromiseCallback that is triggered when section is closing
onExpand() => void \| PromiseCallback that is triggered when section is expanding
titleReact.NodeThe title of the CardSection
titleAsenum"h2"The element used for the root node of the title of CardSection.

enum

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