Skip to content

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

Closed

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.

Activity

  1. cchaos commented on Feb 18, 2021

    @cchaos
    Contributor

    This is something that I have fought with for a long time. This first sentence in the docs has been up there since the creation of EuiCard and was to set the tone for what a card is:

    At its core an EuiCard should contain a title,description, and an icon.

    And in a similar vein, the sentence that you copied says:

    In the event that you need more than just paragraph text for the description,

    Means, that a description (rendering as paragraph text) is still required.

    But I guess I give up and we'll just need to mark description as optional.

  2. patelaryan7751 commented on Feb 20, 2021

    @patelaryan7751

    can i work on this issue? @chandlerprall

  3. chandlerprall commented on Feb 22, 2021

    @chandlerprall
    ContributorAuthor

    @patelaryan7751 go ahead; any issue not assigned + doesn't have a comment with someone actively working on it is free to take on!

  4. hetanthakkar commented on Feb 25, 2021

    @hetanthakkar
    Contributor

    @patelaryan7751 you still working on this issue?

  5. patelaryan7751 commented on Feb 25, 2021

    @patelaryan7751

    @patelaryan7751 you still working on this issue?

    i am busy with acads yaa you can work

  6. hetanthakkar commented on Feb 25, 2021

    @hetanthakkar
    Contributor

    @chandlerprall I have submitted a PR for this issue. Could you please review it!

  7. hetanthakkar commented on Mar 1, 2021

    @hetanthakkar
    Contributor

    @myasonik I've made the required changes could you please check

  8. cchaos commented on Mar 16, 2021

    @cchaos
    Contributor

    Closed by #4582

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions