Skip to content

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

Open
rrambul wants to merge 3 commits intoshoelace-style:nextfrom
rrambul:renanrsilva/adds-support-for-custom-icons
Open

Adds support for custom checked icons in checkbox and option components#2425
rrambul wants to merge 3 commits intoshoelace-style:nextfrom
rrambul:renanrsilva/adds-support-for-custom-icons

Conversation

@rrambul
Copy link

@rrambul rrambul commented Apr 8, 2025

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.

@vercel
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

@rrambul
Copy link
Author

rrambul commented May 21, 2025

@claviska would you mind reviewing when you get a chance? Thanks!

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