Semantic UI React: How to center forms
Date: 2019-06-24 | form | react | semantic-ui | tutorial |
DISCLOSURE: If you buy through affiliate links, I may earn a small commission. (disclosures)
problem
I have a Semantic UI React Form.Group that contains radio buttons. I want those buttons to be centered, but the usual center aligned css classes don't seem to be doing the trick. How can I center this form?
solution
You can center this Form.Group (or even the entire Form itself) by wrapping the Form in a Semantic UI React Grid and then adding the center aligned classes to it.
So a centered Form might look something like:
<Grid className="center aligned">
<Form>
<Form.Group>
...
</Form.Group>
<Form.Group>
...
</Form.Group>
</Form>
</Grid>
source
did this help?
I regularly post about tech topics I run into. You can get a periodic email containing updates on new posts and things I've built by subscribing here.
Want more like this?
The best way to support my work is to like / comment / share for the algorithm and subscribe for future updates.
