How to center align button in Semantic UI React?

Arash picture Arash · Jan 19, 2019 · Viewed 9.2k times · Source

how can I center align a button in Semantic UI React
I have tried several approaches, using Grid, Grid Row, but no success

import {Segment, Button,Label,Sticky,Grid,Container} from 'semantic-ui-react';
import React, {Component} from 'react';

const GeneralSupportSegment =() => (
    <Segment>
         <Label  ribbon color="blue"  size="large">Support</Label>
         <Button>contact us</Button>
    </Segment>
);

export default GeneralSupportSegment;

Answer

grenzbotin picture grenzbotin · Jan 19, 2019

Would be nice if you could share what you tried to do.

One solution might be:

<Segment>
  <Label ribbon color="blue" size="large">Support</Label>
  <Grid>
    <Grid.Column textAlign="center">
      <Button>contact us</Button>
    </Grid.Column>
  </Grid>
</Segment>

You can see it working here: https://codesandbox.io/s/z2pkv0ro43