Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

ionic Forms and Input Boxes

ionic Forms and Input Boxes

The list class can also be used for input elements. The item-input and item classes specify the text box and its label.

Input Box Property: placeholder

In the following example, the default is 100% width (no border on left or right), and the placeholder property is used to set a hint for the expected value of the input field.



Try it »

Input Box Property: input-label

Use input-label to place the label on the left side of the input box.



Try it »


Stacked Labels

Stacked labels are usually located at the top of the input box. Each option is specified with the item-stacked-label class. Each input box needs to specify input-label. The following example also uses the placeholder property to set an input hint.



Try it »


Floating Labels

Floating labels are similar to stacked labels, but floating labels have an animation effect; each option needs to specify the item-floating-label class, and the input label needs to specify input-label.



Try it »


Inset Forms

By default each input field is 100% wide, but we can use the list list-inset or card class to set the form's padding; the card class has a shadow.



Try it »


Inset Input Fields

Use list-inset to set an inset solid list. Use the item-input-inset style to inset a button.



Try it »


Input Boxes with Icons

Icons can be easily added to item-input boxes. An icon can be placed before .



Try it »


Header Input Boxes

Input boxes can be placed in the header, with submit or cancel buttons added.



Try it »