CardBlock is used to normalize font sizes for content and to provide consistent margins and padding.
Examples #
Import Syntax #
import Card, { CardBlock } from 'mineral-ui/Card';
Note
Cards normally occupy the full available width of their container. The Cards here are width-constrained for illustration purposes.
Provide Consistent Spacing #
CardBlock provides uniform spacing (highlighted here in light blue), relative to the other Card components, around its content.
Card Title
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec mattis
pretium massa. Aliquam erat volutpat. Nulla facilisi.
<DemoLayout> <Card> <CardTitle>Card Title</CardTitle> <CardBlock>{loremIpsum}</CardBlock> </Card> </DemoLayout>
Arbitrary Children #
A CardBlock will render any children.
Card Title
<DemoLayout> <Card> <CardTitle>Card Title</CardTitle> <CardBlock>{customContent}</CardBlock> </Card> </DemoLayout>
API & Theme #
CardBlock Theme Variables #
These variables can be used as hooks to override this component's
style at either a
local
or global
level. The theme
referenced below is whatever theme is available
from props to the instance of this component.
Variable | Value |
---|---|
CardBlock_fontSize | theme.fontSize_ui |
CardBlock_lineHeight | theme.lineHeight_prose |