-
Notifications
You must be signed in to change notification settings - Fork 55
feat(uui-card): Adds checkbox for selection #1138
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new checkbox selection feature to various card components within the UUI library. Key changes include:
- Adding a dependency on uui-checkbox and importing it in uui-card.
- Implementing a renderCheckbox() method in uui-card and integrating it into the derived card components (User, Media, Content Node, and Block Type).
- Updating the corresponding Storybook stories to demonstrate selectable card variants.
Reviewed Changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/uui-card/tsconfig.json | Added reference to uui-checkbox to enable checkbox feature. |
packages/uui-card/package.json | Added dependency on uui-checkbox. |
packages/uui-card/lib/uui-card.element.ts | Introduced renderCheckbox() and imported uui-checkbox. |
packages/uui-card-user/* | Integrated renderCheckbox() into card user element and updated story. |
packages/uui-card-media/* | Integrated renderCheckbox() and updated story; removed "width: 100%" from #content CSS. |
packages/uui-card-content-node/* | Integrated renderCheckbox() and updated styling for #select-checkbox. |
packages/uui-card-block-type/* | Integrated renderCheckbox() and updated story configuration. |
Comments suppressed due to low confidence (1)
packages/uui-card-media/lib/uui-card-media.element.ts:210
- The removal of 'width: 100%;' from the #content styling could impact layout consistency compared to other card components. Consider confirming that this change aligns with the intended design and layout behavior for media cards.
display: flex;
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-1138.westeurope.azurestaticapps.net |
Description
Following the proposed implementation of displaying a checkbox on a Media Card in the Umbraco CMS backoffice, umbraco/Umbraco-CMS#19616, we agreed that this feature should be done natively across cards in the UUI library.
Types of changes
Motivation and context
As a UX enhancement, a checkbox has been added to selectable cards to provide a visual indicator that the card can be selected, (rather than attempting to click the card's border).
How to test?
Important
Please note, the checkbox will only be available when the card is in
selectable
mode.The checkbox will only appear when the card is focused (or being hovered).
In the Storybook, for a Media Card, does toggling the checkbox perform a select/deselect action? Does clicking the card's border toggle the checkbox? Does keyboard navigation work with the select/deselect interaction?
The hover-over checkbox has been added to the following card types: Block Type Card, Content Node Card, Media Card and User Card. It has not been added to the base
uui-card
.Screenshots (if appropriate)
Recording.2025-06-30.185647.mp4