CardFooter


目录

CardFooter renders an optional footer within a Card.

Usage

import { Card, CardFooter } from '@wordpress/components';

const Example = () => (
    <Card>
        <CardBody>...</CardBody>
        <CardFooter>...</CardFooter>
    </Card>
);

Flex

Underneath, CardFooter uses the Flex layout component. This improves the alignment of child items within the component.

import {
    Button,
    Card,
    CardFooter,
    FlexItem,
    FlexBlock,
} from '@wordpress/components';

const Example = () => (
    <Card>
        <CardBody>...</CardBody>
        <CardFooter>
            <FlexBlock>Content</FlexBlock>
            <FlexItem>
                <Button>Action</Button>
            </FlexItem>
        </CardFooter>
    </Card>
);

Check out the documentation on Flex for more details on layout composition.

Props

Note: This component is connected to Card‘s Context. The value of the size and isBorderless props is derived from the Card parent component (if there is one). Setting these props directly on this component will override any derived values.

isBorderless: boolean

Renders without a border.

isShady: boolean

Renders with a light gray background color.

justify: CSSProperties[ 'justifyContent' ]

See the documentation for the justify prop for the Flex component

size: string | object

Determines the amount of padding within the component. Can be specified either as a single size token or as an object.


版本号 #2
由 壳壳虫 创建于 2026-10-31 18:16:07 UTC
由 壳壳虫 更新于 2026-10-31 18:16:09 UTC