Skip to content

[EuiCard] card's children is an escape hatch but description is still required #4546

@chandlerprall

Description

@chandlerprall

EuiCard's Custom children example states

In the event that you need more than just paragraph text for the description, you can pass anything you need as the children of the component.

but even in that case, description is always required. There's an additional complication where, if you want the card's description to be a single block-level element, the entire content must be passed as children and nothing provided to description, as everything in description is wrapped in EuiText>p, and React console.warn's about invalid DOM nesting.

description's type definition includes boolean - mostly by accident - so passing description={false} effectively skirts the issue but the EuiText>p is still rendered with empty content. We should add a quick conditional around that rendering to better support this use case.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions