Card
Cards are a self-contained unit of information, usually as part of a feed or series of similar content. Cards have a dynamic range of modifiers that allow text-only, text and illustration, and photography. All cards have an option to include text links or buttons as a primary action. The entire card can become an active click-target.
Examples
Overrides
Additionally, you can fully customize any part of the Card through the overrides prop. The Card consists of multiple subcomponents that are listed bellow and you can override each one of them. To help you identify the names of these subcomponents, you can highlight them through this selector:
Example card
Note: You should always use longhand CSS properties. Mixing shorthands and longhands will lead into strange behaviors!
API
Card API
action import = null
Contents to be rendered at the bottom of the Card. Used to organize UI which enables user action.
react.Nodechildren import = null
Content to be rendered within the Card body.
react.NodehasThumbnail function = hasThumbnail
Function that takes Card props and returns a boolean that represents if a thumbnail will be rendered.
thumbnail string => booleanheaderImage string
Image src to be positioned at the top of the Card.
overrides object = {}
Action { component: ?ComponentType<<T> & { children: Node }>, props: ?{} | ({}) => ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T> & { children: Node }>ObjectBody { component: ?ComponentType<<T> & { children: Node }>, props: ?{} | ({}) => ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T> & { children: Node }>ObjectContents { component: ?ComponentType<<T> & { children: Node }>, props: ?{} | ({}) => ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T> & { children: Node }>ObjectHeaderImage { component: ?ComponentType<<T> & { children: Node }>, props: ?{} | ({}) => ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T> & { children: Node }>ObjectRoot { component: ?ComponentType<<T> & { children: Node }>, props: ?{} | ({}) => ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T> & { children: Node }>ObjectThumbnail { component: ?ComponentType<<T> & { children: Node }>, props: ?{} | ({}) => ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T> & { children: Node }>ObjectTitle { component: ?ComponentType<<T> & { children: Node }>, props: ?{} | ({}) => ?{}, style: ?{} | ({}) => ?{} }<<T>> | ComponentType<<T> & { children: Node }>Objectthumbnail string
Image src that by default is rendered to the side of children content.
title import
Content to render above the body content.
react.NodeCard exports
You can import this module like so:
import {Card} from 'baseui/card'
It exports the following components or utility functions:
- Card
- hasThumbnail
- StyledAction
- StyledBody
- StyledContents
- StyledHeaderImage
- StyledThumbnail
- StyledTitle
- StyledRoot
- StyledWrapper