Segment with 100% width on iOS


We are using Ionic React 5.0.7.

On iOS, segments don’t have 100% width but a fixed width (in which the actual width depends on the number of segment buttons).

We would like to style a segment with 2 buttons so that it is always displayed as 100% width, with each of the 2 segment buttons using 50% width. We can set the width of the IonSegment to 100%, which causes the segment div to be 100% width instead of a fixed width. If we try to set the width of the 2 segment buttons to 50%, it has no effect. The width is still fixed, and not 100% wide.

Anyone ideas on how to set the width of a segment with 2 segment buttons to 100% on iOS?

Thank you,


code? because I am not seeing this issue


Hi Aaron,

Thanks for the reply.

It turns out that the behavior is caused by wrapping the segment inside an IonToolbar.

I’m displaying the segment as header as shown in the example here:

In that example, the segment is wrapped inside an IonToolbar, which causes the width to be fixed (not 100%). If I remove the IonToolbar and have the segment as the code in your example, it is 100% width.

For now, I think I will skip the IonToolbar.

Kind regards,


Hi Aaron,

I’ve marked your answer (not having a IonToolbar as parent) as solution. In my case I can wrap the segment as follows:

<IonHeader translucent={true}>
  <IonItem className="ion-no-padding ion-no-margin" id="segment-item">
    <IonSegment onIonChange={(e) => toggleSegment(e.detail!.value!)}>

Using the IonItem I can set the appropriate margins and paddings.