Title: Card
Published: March 9, 2021
Last modified: October 14, 2026

---

# Card

## In this article

 * [Usage](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#usage)
 * [Props](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#props)
    - [elevation: number](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#elevation-number)
    - [isBorderless: boolean](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#isborderless-boolean)
    - [isRounded: boolean](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#isrounded-boolean)
    - [size: string | object](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#size-string-object)
    - [Inherited props](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#inherited-props)
 * [Sub-Components](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#sub-components)
    - [Sub-Components Example](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#sub-components-example)
    - [Logical Padding Properties](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#logical-padding-properties)
    - [Context](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#context)

`Card` provides a flexible and extensible content container.

## 󠀁[Usage](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#usage)󠁿

`Card` also provides a convenient set of [sub-components](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#sub-components)
such as `CardBody`, `CardHeader`, `CardFooter`, and more (see below).

    ```language-jsx
    import {
        Card,
        CardHeader,
        CardBody,
        CardFooter,
        __experimentalText as Text,
        __experimentalHeading as Heading,
    } from '@wordpress/components';

    function Example() {
        return (
            <Card>
                <CardHeader>
                    <Heading level={ 4 }>Card Title</Heading>
                </CardHeader>
                <CardBody>
                    <Text>Card Content</Text>
                </CardBody>
                <CardFooter>
                    <Text>Card Footer</Text>
                </CardFooter>
            </Card>
        );
    }
    ```

## 󠀁[Props](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#props)󠁿

### 󠀁[elevation: number](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#elevation-number)󠁿

Size of the elevation shadow, based on the Style system’s elevation system. This
may be helpful in highlighting certain content. For more information, check out 
[`Elevation`](https://developer.wordpress.org/block-editor/reference-guide/components/elevation/).

 * Required: No
 * Default: `0`

### 󠀁[isBorderless: boolean](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#isborderless-boolean)󠁿

Renders without a border.

 * Required: No
 * Default: `false`

### 󠀁[isRounded: boolean](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#isrounded-boolean)󠁿

Renders with rounded corners.

 * Required: No
 * Default: `true`

### 󠀁[size: string | object](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#size-string-object)󠁿

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

 * Required: No
 * Default: `medium`
 * Allowed values:
    - Single size token: `none`, `xSmall`, `small`, `medium`, `large`
    - Object:
 *     ```typescript
       {
         blockStart: 'none' | 'xSmall' | 'small' | 'medium' | 'large';
         blockEnd: 'none' | 'xSmall' | 'small' | 'medium' | 'large';
         inlineStart: 'none' | 'xSmall' | 'small' | 'medium' | 'large';
         inlineEnd: 'none' | 'xSmall' | 'small' | 'medium' | 'large';
       }
       ```
   

### 󠀁[Inherited props](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#inherited-props)󠁿

`Card` also inherits all of the [`Surface` props](https://developer.wordpress.org/block-editor/reference-guide/components/surface/#props).

## 󠀁[Sub-Components](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#sub-components)󠁿

This component provides a collection of sub-component that can be used to compose
various interfaces.

 * [`<CardBody />`](https://developer.wordpress.org/block-editor/reference-guide/components/card/card-body/)
 * [`<CardDivider />`](https://developer.wordpress.org/block-editor/reference-guide/components/card/card-divider/)
 * [`<CardFooter />`](https://developer.wordpress.org/block-editor/reference-guide/components/card/card-footer/)
 * [`<CardHeader />`](https://developer.wordpress.org/block-editor/reference-guide/components/card/card-header/)
 * [`<CardMedia />`](https://developer.wordpress.org/block-editor/reference-guide/components/card/card-media/)

### 󠀁[Sub-Components Example](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#sub-components-example)󠁿

    ```language-jsx
    import {
        Card,
        CardBody,
        CardDivider,
        CardFooter,
        CardHeader,
        CardMedia,
    } from '@wordpress/components';

    const Example = () => (
        <Card>
            <CardHeader>...</CardHeader>
            <CardBody>...</CardBody>
            <CardDivider />
            <CardBody>...</CardBody>
            <CardMedia>
                <img src="..." />
            </CardMedia>
            <CardFooter>...</CardFooter>
        </Card>
    );
    ```

### 󠀁[Logical Padding Properties](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#logical-padding-properties)󠁿

The `size` prop supports logical properties that adapt to different writing directions:

 * `blockStart` – Maps to `top` in horizontal writing modes
 * `blockEnd` – Maps to `bottom` in horizontal writing modes
 * `inlineStart` – Maps to `left` in horizontal left-to-right writing modes
 * `inlineEnd` – Maps to `right` in horizontal left-to-right writing modes

    ```language-jsx
    import { Card, CardBody } from '@wordpress/components';

    const Example = () => (
        <Card
            size={ {
                blockStart: 'large',
                blockEnd: 'small',
                inlineStart: 'medium',
                inlineEnd: 'medium',
            } }
        >
            <CardBody
                size={ {
                    blockStart: 'small',
                    inlineStart: 'large',
                    inlineEnd: 'large',
                } }
            >
                Content with logical padding properties
            </CardBody>
        </Card>
    );
    ```

### 󠀁[Context](https://developer.wordpress.org/block-editor/reference-guides/components/card/?output_format=md#context)󠁿

`<Card />`‘s sub-components are connected to `<Card />` using [Context](https://react.dev/learn/passing-data-deeply-with-context).
Certain props like `size` and `isBorderless` are passed through to some of the sub-
components.

In the following example, the `<CardBody />` will render with a size of `small`:

    ```language-jsx
    import { Card, CardBody } from '@wordpress/components';

    const Example = () => (
        <Card size="small">
            <CardBody>...</CardBody>
        </Card>
    );
    ```

These sub-components are designed to be flexible. The Context props can be overridden
by the sub-component(s) as required. In the following example, the last `<CardBody/
>` will render its specified size:

    ```language-jsx
    import { Card, CardBody } from '@wordpress/components';

    const Example = () => (
        <Card size="small">
            <CardBody>...</CardBody>
            <CardBody>...</CardBody>
            <CardBody size="large">...</CardBody>
        </Card>
    );
    ```

First published

March 9, 2021

Last updated

October 14, 2026

Edit article

[ Improve it on GitHub: Card ](https://github.com/WordPress/gutenberg/edit/trunk/packages/components/src/card/card/README.md)

[  Previous: DateCalendar](https://developer.wordpress.org/block-editor/reference-guides/components/date-calendar/)

[  Next: DateRangeCalendar](https://developer.wordpress.org/block-editor/reference-guides/components/date-range-calendar/)