CardBody 是 WordPress 组件库中的一个组件,用于在 Card 内渲染可选的内容区域。它支持多个 CardBody 嵌套使用,并可通过 props 控制滚动、背景和内边距等样式。
import { Card, CardBody } from '@wordpress/components';
const Example = () => (
<Card>
<CardBody>...</CardBody>
</Card>
);CardBody renders an optional content area for a Card. Multiple CardBody components can be used within Card if needed.
import { Card, CardBody } from '@wordpress/components';
const Example = () => (
<Card>
<CardBody>...</CardBody>
</Card>
);
Note: This component is connected to Card‘s Context. The value of the size prop is derived from the Card parent component (if there is one). Setting this prop directly on this component will override any derived values.
isScrollable: booleanDetermines if the component is scrollable.
falseisShady: booleanRenders with a light gray background color.
falsesize: string | objectDetermines the amount of padding within the component. Can be specified either as a single size token or as an object.
mediumnone, xSmall, small, medium, large{
blockStart: 'none' | 'xSmall' | 'small' | 'medium' | 'large';
blockEnd: 'none' | 'xSmall' | 'small' | 'medium' | 'large';
inlineStart: 'none' | 'xSmall' | 'small' | 'medium' | 'large';
inlineEnd: 'none' | 'xSmall' | 'small' | 'medium' | 'large';
}