-
Notifications
You must be signed in to change notification settings - Fork 843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow different element type for EuiCard description #1015
Comments
We've employed the pattern of including a |
@chandlerprall That's when it's absolutely necessary to wrap the children in a parent element. For this type of case, I think we just need to allow a string or node, and if it's a string we wrap it in a paragraph tag. We'll want to do the same for the title. #979 |
I gave this some more thought and I looked at the implementation in cloud (screenshot from the mentioned issue) and honestly, those are so far different from the basic card concept, that it can and should just be a custom component built with In the end, I'm going to leave the description as-is and close this ticket in favor of consumers creating their own "card"s when their content doesn't match the default |
I understand the reasons for closing the issue, but I'd ask that you reconsider. Cloud UI was in fact using its own card component, but I changed it to use EUI's as it correctly positions the footer icons. If you ignore the content of cards, it's a component with a title, some content, a footer, and possibly a badge - just what Cloud needs. We would be copying the source verbatim but changing |
+1, forcing the kind of children is not something that's done elsewhere in EUI, so I'd favor consistency. Originally CJ had string prop types for many things that were meant to be any kind of children, so that might be the source of the dissonance here, but most of these where changed to a node proptype so we can do whatever we see fit. Prescribing too much semantics (and styling based around that) is not a great long term approach imo |
EuiCard wraps the description in
<p>
tags. It would be useful to be able to change this to e.g.<div>
to avoid warnings about invalid DOM nesting, such as when putting a list in the description.The text was updated successfully, but these errors were encountered: