Skip to content

PropertyList component to match design system requirements#597

Open
Mahek-Vasoya wants to merge 8 commits intomasterfrom
property-list/adding-design-system-features
Open

PropertyList component to match design system requirements#597
Mahek-Vasoya wants to merge 8 commits intomasterfrom
property-list/adding-design-system-features

Conversation

@Mahek-Vasoya
Copy link
Collaborator

@Mahek-Vasoya Mahek-Vasoya commented Feb 24, 2026

This PR introduces a new implementation of PropertyList and Property with built-in support for multi-line clamping and expandable values.

Key Features

Layout compatibility

  • Supports both horizontal and vertical orientations.
  • Allows property sizing via the size prop (small, medium, large, full-width).
  • Uses flexible layout to automatically wrap properties across rows.

Multi-line clamping (expandable)

  • Supports configurable clampLines (default: 4).
  • Displays ellipsis (...) when content overflows.
  • Adds a “View more / View less” toggle when content exceeds the clamp limit.

Expand / Collapse behavior

  • Expands or collapses the property value without affecting the surrounding layout.
  • Toggle is self-contained within the Property component.

Notes

  • Clamping is only applied when value is a string.
  • Layout remains responsive using flex wrapping.

Example

<PropertyList>
  <PropertyList.Property
    size="Large"
    label="Description"
    value={longText}
    expandable
    clampLines={3}
  />
</PropertyList>
Screenshot 2026-03-06 at 5 53 44 PM Screenshot 2026-03-06 at 5 53 54 PM Screenshot 2026-03-06 at 5 54 01 PM Screenshot 2026-03-06 at 5 54 09 PM Screenshot 2026-03-06 at 5 54 13 PM Screenshot 2026-03-06 at 5 54 19 PM Screenshot 2026-03-06 at 5 54 25 PM Screenshot 2026-03-06 at 5 54 29 PM Screenshot 2026-03-06 at 5 54 36 PM Screenshot 2026-03-06 at 5 54 40 PM Screenshot 2026-03-06 at 5 54 45 PM

@Mahek-Vasoya Mahek-Vasoya changed the title Added design system functionality and styles to PropertyList component PropertyList component to match design system requirements Feb 24, 2026
@Mahek-Vasoya Mahek-Vasoya self-assigned this Feb 24, 2026
@Mahek-Vasoya Mahek-Vasoya added the enhancement New feature or request label Feb 24, 2026
@Mahek-Vasoya Mahek-Vasoya marked this pull request as ready for review February 25, 2026 06:58
</div>

{/* Toggle */}
{enableClamping && isStringValue && (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we also should have a way that we do not show the "View more" button if the text is not actually clamped. This would be hard to do however because we cannot reliably detect if the browser has cut off the text (just counting characters is not sufficient). So currently we leave it up to the consumer to not enable clamping if the text is short?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try to check a few things on this. I guess we can achieve this, but that can be a follow-up issue.

@Mahek-Vasoya Mahek-Vasoya requested a review from mkrause March 6, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants