Update checkbox docs to support label slot (2025-10)#4418
Conversation
🚨🚨🚨 Docs migration in progress 🚨🚨🚨We are actively migrating UI extension reference docs to MDX in the
During this migration, please be aware of the following:
Doc comments in Examples that previously lived in this repo are being moved to the What should I do?
Thanks for your patience while we complete the migration! 🙏 |
mcvinci
left a comment
There was a problem hiding this comment.
Thanks, @justinhenricks! Just left one minor comment.
| title: 'Slots', | ||
| description: | ||
| 'Learn more about [component slots](/docs/api/checkout-ui-extensions/latest/using-polaris-components#slots).', | ||
| type: 'CheckboxElementSlots', |
There was a problem hiding this comment.
We can remove this change. doc.ts files are now considered legacy files, as this content how now moved to MDX in the shopify-dev zone of the monorepo.
ea2b6ad to
a12d6b5
Compare
Background
The
labelprop on thes-checkboxcomponent previously only accepted a plain string value, limiting the ability to include rich content such as links within checkbox labels.Depends on: https://github.com/shop/world/pull/663974
Solution
The
labelprop on the checkout and customer-accounts-checkboxcomponent now accepts either a plain string or anHTMLElementslot. When passed as anHTMLElement, only plain text ands-linkelements are rendered as label content — any additional elements are sanitized while preserving their text content.A new
CheckboxElementSlotsinterface has been introduced to define this slot behavior, and thelabelprop has been moved out ofCheckboxElementPropsand intoCheckboxElementSlotsto reflect this distinction. The component documentation has also been updated to include slot definitions.🎩
s-checkboxlabels can now includes-linkelements for richer, more accessible label contentChecklist