Skip to content

Compact and Transparent variants for Card #11139

@rolfsmeds

Description

@rolfsmeds

Describe your motivation

In lieu of a dedicated standalone "item" component, Card could be used as one, as it offers similar layout options.

As an example, creating these kinds of patterns currently requires a lot of elements and css

Image

Card could be used for this by setting the horizontal variant, but removing the background and border, and reducing white space and font sizes, is cumbersome (as it requires modifying several style properties).

Describe the solution you'd like

Introduce 2 new variants:

  • compact which removes padding, reduces the horizontal gap, and reduces title and subtitle font sizes
  • transparent which removes background and border

With those variants, it would be easy to achieve this by a combination of horizontal, compact and transparent variants:

Image

(Additionally, the default role="region" should be changed to generic, which is already supported with existing API.)

Describe alternatives you've considered

Implement a dedicated Item component.

Additional context

These features would both act as a stop-gap until we have an Item component, and they can also be useful for things that are actually supposed to be Cards, but where, for various reasons, background is undesired, and/or a more compact rendering is desired.

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