Label position left of control #30167
-
In many cases, I need the label of the control to the left of the control rather than above. No luck 😒 Anyone has the the magic CSS trick to do it for all fluentUI controls? |
Beta Was this translation helpful? Give feedback.
Answered by
sopranopillow
Dec 28, 2023
Replies: 1 comment 3 replies
-
Which component are you trying to modify? there's a chance that the root is not the container of the label + component |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you are interested, v9 does follow that idea, but I understand if migrating is not an option. That being said, one way to quickly know which classname in the styles you should use is by taking a look at the component's base implementation i.e. ChoiceGroup.base.tsx. Here's the render function for ChoiceGroup:
fluentui/packages/react/src/components/ChoiceGroup/ChoiceGroup.base.tsx
Line 159 in 167ccce
as you can see, there's a wrapper impeding the quick fix you showed from working. this will require some selectors in the styles, something like this: