SegmentButton

Improve this doc

The child buttons of the ion-segment component. Each ion-segment-button must have a value.

Component

selector: ion-segment-button

Usage

<ion-segment [(ngModel)]="relationship" primary>
  <ion-segment-button value="friends" (select)="selectedFriends()">
    Friends
  </ion-segment-button>
  <ion-segment-button value="enemies" (select)="selectedEnemies()">
    Enemies
  </ion-segment-button>
</ion-segment>

Or with FormBuilder

<form [ngFormModel]="myForm">
  <ion-segment ngControl="mapStyle" danger>
    <ion-segment-button value="standard">
      Standard
    </ion-segment-button>
    <ion-segment-button value="hybrid">
      Hybrid
    </ion-segment-button>
    <ion-segment-button value="sat">
      Satellite
    </ion-segment-button>
  </ion-segment>
</form>

Input Properties

Attr Type Details
value string

the value of the segment button. Required.

Output Events

Attr Details
select

expression to evaluate when a segment button has been clicked

Related

Segment Component Docs, Segment API Docs

API

Native

General