Replies: 2 comments 1 reply
-
You can use arbitrary selector with tailwind |
Beta Was this translation helpful? Give feedback.
1 reply
-
We don't allow styling those elements as they are intended to only contain the text so it can be aligned properly between the value in the trigger and the item's text. You can however simply wrap it with an extra element where you apply whichever styles you want. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey 👋🏻
I'm looking at implementing Radix UI's Select but I've noticed that you cannot make the
Select.ItemText
truncate as it is within aspan
and we're unable to assign classes or styles to it.Within my component I accept an array of
options
, an attribute on an option istext
, this text can be longer than the input (especially when stubbing the input short).As I'm using Tailwind, and a complex item, I need to assign the
truncate
class to the surroundingspan
element created byRSelect.ItemText
but classes are not passed along to the span.Why the docs say it does not encourage styling the
ItemText
in these cases we should be able to.Any ideas for the best work around?
Edit 1: Continued investigation seems like it's the
RSelect.Value
that requires the ability to accept classes or styles – notSelect.ItemText
Beta Was this translation helpful? Give feedback.
All reactions