Skip to content

Variant for slot doesn't work #44272

Closed

Description

@twawszczak

Search keywords

variants, slots, props, evaluation

Latest version

  • I have tested the latest version

Steps to reproduce

Link to live example: https://stackblitz.com/edit/github-rv6vtunv

Steps:

  1. Customize theme with components => MuiSelect => styleOverrides
  2. Define a variant for root and icon slots, both with props: props: { size: 'small' }

Current behavior

Variant for root is recognized and applied, for icon - it's not

Expected behavior

As far as I understand, also a variant for a slot should work.

Context

I tried for the icon a hardcoded props evaluation:

props: () => true

and it works. I also debugged size prop evaluation with:

props: ({ size }) => console.log(size)

and initially it has correct value small but immediately during next evaluation it's undefined What's surprising for me, it behaves exactly the same for root, but doesn't break variant's styling for root 🤔

Your environment

No response

Activity

  1. added
    status: waiting for maintainer
    on Oct 30, 2024
  2. added
    customization: theme
    on Oct 30, 2024
  3. siriwatknp commented on Nov 18, 2024

    @siriwatknp
    Member

    Thanks for reporting the issue. I will take a look.

  4. added
    type: bug
    scope: select
    customization: dom
    and removed
    status: waiting for maintainer
    on Nov 18, 2024
  5. iamAfrontendDev commented on Sep 3, 2025

    @iamAfrontendDev

    Hello @siriwatknp

    I have reviewed this issue and was able to reproduce the behavior locally—variants defined for non-root slots (such as icon) do not appear to be applied as expected.

    Before proceeding with a potential fix, I wanted to ask whether supporting slot-based variants is something the team would consider appropriate. Alternatively, should developers rely on styleOverrides for this type of customization?

    I have the repository set up locally and would be happy to contribute a fix or documentation update, depending on the intended direction. Please let me know what you think.

    Thank you.

  6. added a commit that references this issue on May 10, 2026
    04b2cf7
  7. github-actions commented on Nov 20, 2026

    @github-actions
    Contributor

    This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
    Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.


    @twawszczak Thanks again for creating this issue! If you have a moment, we would love to hear your thoughts on how we handled it with this short feedback form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

customization: domcustomization: themescope: selecttype: bug

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions