Skip to content

Adds support for custom checked icons in checkbox and option components #2425

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

Open
wants to merge 3 commits into
base: next
Choose a base branch
from

Conversation

RenanRSilva
Copy link

closes #2424

Summary

This PR adds support for custom icons in the checkbox and option components.

  • Adds support for a custom checked icon in the checkbox component

  • Adds support for a custom indeterminate icon in the checkbox component

  • Adds support for a custom selected icon in the option component (used in select)

Motivation

The idea is to expose slots for the checked and indeterminate icons in the checkbox component, as well as for the selected icon in the option component. This allows them to be replaced when desired, while keeping the current icons as defaults.

Context

See discussion: shoelace-style/shoelace#2325

Detailed Description

To implement this, the checkbox and option components were updated to wrap the current icons inside named slots. This preserves the existing behavior but enables consumers to override the icons by providing custom content via the new slots.

Copy link

vercel bot commented Apr 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
shoelace ✅ Ready (Inspect) Visit Preview Apr 8, 2025 3:29am

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.

Adds support for custom checked icons in checkbox and option components
1 participant