Skip to content
Tutorials Center
My learning

Topics

Lesson 16 of 37 ยท Forms and Data

Ionic Form Controls: Input, Select, Toggle and More

Tour the Ionic form components: input, textarea, select, checkbox, radio, toggle, range and datetime, with labels, helper text, binding and events.

Ionic supplies a full set of touch-friendly form controls: text input, select, checkbox, radio, toggle, range slider, date and time pickers. They share a common API: a label, a value, a placeholder, an ionChange event and optional helper and error text. This lesson walks through each control, then shows how values are bound in each framework and how to read them reliably.

ion-input

HTML
<ion-input
  label="Email"
  labelPlacement="floating"
  type="email"
  placeholder="[email protected]"
  helperText="We never share it"
  errorText="Enter a valid email"
  fill="outline"
  clearInput="true"
></ion-input>
Property Purpose
label Visible text; the modern replacement for a separate ion-label
labelPlacement start, end, fixed, stacked, floating
type text, email, password, number, tel, url, search
fill outline or solid Material style fields
helperText, errorText Hint and error message below the field
counter, maxlength Character counter and limit
clearInput Shows a clear button

Setting the correct type matters on phones because it chooses the right keyboard (email keyboard with @, numeric pad for tel). inputmode and autocomplete give finer control. Use enterkeyhint="next" or "done" to label the Enter key.

Events: ionInput fires on every keystroke, ionChange fires when the value is committed (on blur or Enter), ionBlur and ionFocus track focus.

Textarea, select, checkbox, radio, toggle

HTML
<ion-textarea label="Notes" labelPlacement="stacked" rows="4" autoGrow="true"></ion-textarea>

<ion-select label="Country" placeholder="Pick one" interface="popover">
  <ion-select-option value="de">Germany</ion-select-option>
  <ion-select-option value="jp">Japan</ion-select-option>
  <ion-select-option value="br">Brazil</ion-select-option>
</ion-select>

<ion-checkbox labelPlacement="end" justify="start">I agree to the terms</ion-checkbox>

<ion-radio-group value="monthly">
  <ion-radio value="monthly">Monthly</ion-radio>
  <ion-radio value="yearly">Yearly</ion-radio>
</ion-radio-group>

<ion-toggle checked="true">Notifications</ion-toggle>

Details:

  • ion-select supports multiple="true", and interface of alert, action-sheet, popover or modal (the modal variant is good for long lists).
  • Checkbox and toggle use checked; their event reports event.detail.checked.
  • Radios live inside an ion-radio-group, whose value holds the selected one.
  • A toggle means immediate effect (a setting that applies now); a checkbox means a choice confirmed on submit.

Range and segments

HTML
<ion-range label="Volume" min="0" max="100" step="5" pin="true" snaps="true"></ion-range>
<ion-segment value="week">
  <ion-segment-button value="day"><ion-label>Day</ion-label></ion-segment-button>
  <ion-segment-button value="week"><ion-label>Week</ion-label></ion-segment-button>
</ion-segment>

A range can have two knobs with dualKnobs="true", and its value then becomes { lower, upper }.

Dates and times

HTML
<ion-datetime presentation="date" value="2026-03-14" min="2026-01-01" max="2026-12-31"></ion-datetime>
<ion-datetime-button datetime="due"></ion-datetime-button>
<ion-modal keepContentsMounted="true">
  <ng-template><ion-datetime id="due" presentation="date-time"></ion-datetime></ng-template>
</ion-modal>

ion-datetime value is an ISO 8601 string (2026-03-14 or 2026-03-14T09:30:00). Presentations: date, time, date-time, time-date, month, year, month-year. Because the value is a string, parsing and formatting dates are your job. Be careful with time zones: a date-only string should not be turned into a UTC midnight date.

Binding values in each framework

HTML
<!-- Angular, template-driven -->
<ion-input label="Name" [(ngModel)]="name"></ion-input>
JSX
// React
<IonInput label="Name" value={name} onIonInput={(e) => setName(e.detail.value ?? '')} />
HTML
<!-- Vue -->
<ion-input label="Name" v-model="name"></ion-input>

In React you must use onIonInput or onIonChange and read e.detail.value, not the usual onChange. This is the single most common mistake for newcomers.

Stand-in: reading event.detail

This runnable stand-in shows the payload shapes of different controls and a single handler that updates a form model from any of them.

JS Stand-in: one handler for many controls

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Stand-in: ionInput versus ionChange

ionInput fires per keystroke; ionChange fires on commit. A model of the difference:

JS Stand-in: per-keystroke versus committed events

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Practical tips

  • Use ionInput for live validation or search, and ionChange when each change triggers a heavy action.
  • Prefer label and labelPlacement over separate labels so assistive technology associates them.
  • Set autocomplete (email, current-password, one-time-code) so password managers and SMS code autofill work.
  • Wrap forms in a real <form> with a submit button so the keyboard's Go key submits.
  • Scroll to the focused input: Ionic handles the keyboard, but custom fixed elements can cover it.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which event fires on every keystroke in ion-input?

    ionInput fires as the user types; ionChange fires when the value is committed.
  2. 2. What format does ion-datetime use for its value?

    The value is an ISO 8601 string such as 2026-03-14T09:30:00.
  3. 3. In Ionic React, which handler reads an input's text?

    Ionic controls emit custom events and put data in e.detail.
  4. 4. Which control suits a setting that applies immediately?

    Toggles represent an on/off state with immediate effect.

Summary

  • Form controls share label, labelPlacement, placeholder, helperText and errorText.
  • Use the right type, inputmode and autocomplete for good mobile keyboards.
  • ionInput is per keystroke, ionChange is on commit; data lives in event.detail.
  • ion-datetime uses ISO strings; mind time zones.
  • Bind with ngModel, onIonInput + state, or v-model.

Next: Form Validation