Skip to content

Update checkbox docs to support label slot (2025-10)#4418

Merged
justinhenricks merged 1 commit into2025-10from
jhen__update_checkbox_docs_to_support_label_slot__2025-10
May 6, 2026
Merged

Update checkbox docs to support label slot (2025-10)#4418
justinhenricks merged 1 commit into2025-10from
jhen__update_checkbox_docs_to_support_label_slot__2025-10

Conversation

@justinhenricks
Copy link
Copy Markdown
Contributor

Background

The label prop on the s-checkbox component 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 label prop on the checkout and customer-account s-checkbox component now accepts either a plain string or an HTMLElement slot. When passed as an HTMLElement, only plain text and s-link elements are rendered as label content — any additional elements are sanitized while preserving their text content.

A new CheckboxElementSlots interface has been introduced to define this slot behavior, and the label prop has been moved out of CheckboxElementProps and into CheckboxElementSlots to reflect this distinction. The component documentation has also been updated to include slot definitions.

🎩

  • s-checkbox labels can now include s-link elements for richer, more accessible label content

Checklist

  • I have 🎩'd these changes
  • I have updated relevant documentation

@github-actions
Copy link
Copy Markdown
Contributor

🚨🚨🚨 Docs migration in progress 🚨🚨🚨

We are actively migrating UI extension reference docs to MDX in the areas/platforms/shopify-dev zone of the monorepo. This impacts docs for the following surfaces:

During this migration, please be aware of the following:

.doc.ts files are being deprecated. Changes to .doc.ts files in this repo will not be reflected in the new MDX-based docs. If you need to update docs for a reference that has already been migrated, make your changes directly in the areas/platforms/shopify-dev zone of the monorepo instead.

Doc comments in .ts source files (the comment blocks above types and functions) are also affected. Generating docs from these comments currently requires a newer version of the @shopify/generate-docs library that isn't yet available. Updates to doc comments may not produce the expected output until the migration is complete.

Examples that previously lived in this repo are being moved to the areas/platforms/shopify-dev zone of the monorepo and should be authored there going forward.

What should I do?

  • If your PR includes changes to .doc.ts files, doc comments, or examples, please reach out to us in #devtools-proj-templated-refs so we can help ensure your updates are captured correctly.
  • If your PR is limited to source code changes (non-docs), you can ignore this notice.

Thanks for your patience while we complete the migration! 🙏

@justinhenricks justinhenricks requested a review from mcvinci April 30, 2026 19:42
Copy link
Copy Markdown
Contributor

@mcvinci mcvinci left a comment

Choose a reason for hiding this comment

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

Thanks, @justinhenricks! Just left one minor comment.

Comment on lines +24 to +27
title: 'Slots',
description:
'Learn more about [component slots](/docs/api/checkout-ui-extensions/latest/using-polaris-components#slots).',
type: 'CheckboxElementSlots',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@justinhenricks justinhenricks force-pushed the jhen__update_checkbox_docs_to_support_label_slot__2025-10 branch from ea2b6ad to a12d6b5 Compare May 6, 2026 14:08
@justinhenricks justinhenricks merged commit e081b2f into 2025-10 May 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants