Skip to content

How to make the two states of a Switch with text have the same appearance? #3398

Answered by wingkwong
ziyuang asked this question in Q&A
Discussion options

You must be logged in to vote

I have changed the background color to identical, but how can the text colour be equated?

You can pass your custom classes to endContent (or startContent)

endContent: "text-success-foreground"

Also it seems NextUI will clear the classes passed to startContent and endContent? If at all possible, I would also like to give ml-1 to the left label and mr-1 to the right label. How to do it? Thanks.

Not really. If you are talking about margin, then you won't see any changes because label has absolute class. I think what you can do is to increase the width and adjust the padding.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ziyuang
Comment options

@ziyuang
Comment options

@ziyuang
Comment options

@wingkwong
Comment options

Answer selected by ziyuang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants