×

Ionic Input

Ionic Input

Inputs are necessary to collect and process user inputs securely. To be easy for users to communicate, they must follow the process and communication guidelines for each platform. It is a container for an HTML input element with a custom style and additional functionality. It accepts most of the same features as HTML input, but works well on desktops and integrates with the keyboard on mobile devices.

It is intended only for text type inputs, such as "text", "password", "email", "number", "search", "phone" and "URL". It supports all regular text input events, including keyup, keydown, keypress, and more.

Several features can be used to design styles and different input fields, which are listed below.

  • Fixed Inline Labels
  • Inset Labels
  • Floating Labels
  • Placeholder Labels
  • Inline Label
  • Stacked Labels

Fixed Inline Labels: Use fixed to place the label on the left side of the input element. When text is input, then the label does not hide. You can also use placeholder text along with a fixed label. You can add the fixed property with <ion-label> component.

Example: This example explains how you can use the fixed inline labels in ionic application.



Fixed Labels
  
  
  
  
  
  Email id
  
  
  
  Password
  
  
  
  
Log In

Output: After executing this code, you will get the output, as shown below.

Ionic Input

Inset Labels: It will fill each input element 100% of the width of its parent elements. Create the input inset by inserting the inset attribute to the <ion-list> element.

Floating Labels: Floating labels are those labels that animate or float up when the entry is selected. You can add the floating property with the using of <ion-label> component. The following syntax explains how you can use the floating labels in the ionic application.

username

Example:

 
   
   
  Floating Label 
   
   
   
   
   
    
  Email id 
   
   
   
  Password 
   
   
    
  
Log In

Output: After executing this code, you will get the output, as shown below.

Inset Labels

Placeholder Labels: To affect the input's label, you can add the placeholder attribute to an <input> element. The placeholder label is hidden when you entered the text in the input. You can add the placeholder label with the use of <ion-label> element.

Example: This example explains how you can use the placeholder label in the ionic application.

 
   
   
  Placeholder Label 
   
   
   
   
  
  
   
  
  
  
  
 
  
Log In

Output: After executing this code, you will get the output, as shown below.

Placeholder Labels

When you entered the text, then the placeholder is hidden, as shown below.

placeholder is hidden,

Inline Labels: Without any attribute <ion-label> element is known as Inline Labels. When the text is input, then the label does not hide. You can also use placeholder text along with an Inline label.

Example: This example explains how you can use the inline label in the ionic application.


  
  
  Inline Label 
  
  
  
  
  
  
  Email id or Mobile No
  
  
  
  Password
  
  
   
  
Log In

Output: After executing this code, you will get the output, as shown below.

Inline Labels

Stacked Labels: It will always show at the top of the input. You can add the stacked attribute by using the <ion-label> element. You can also use placeholder text along with a Stacked label.

Example: This example explains how you can use the stacked label in the ionic application.

 
   
   
  Stacked Label 
   
   
   
   
  
   
  Email id
  
   
  
  Password
  
   
   
  
Log In

Output: After executing this code, you will get the output, as shown below.

Stacked Labels

Multi-line text input: The textarea component is used for multi-line text input in the ionic application. You can use the <ion-textarea> component for input text. The native Textarea component represented within the <ion-textarea>. It permits to control the user experience and interactivity of the textarea component that makes it better.

The Ionic Textarea does not support loading its quality from the inner content as opposed to the native Textarea feature. The value of the Textarea must be set in the value attribute.

Besides the Ionic properties, the Textarea element accepts the essential Textarea attributes.

Example: This example explains how you can use the multi-line text input in the ionic application.

 
   
   
  Multi-Line Text Input 
   
    
   
   
  
 
  Summary
  
  
  
  
  
  Comment
  
  
 
 
  
  
 
 
  Description
  
 
 
 
  Details
  
 
   

Output: After executing this code, you will get the output, as shown below.

 The textarea compon

Related Topics

Ionic Slides

The ionic slides component is the multi-section container. You can swipe or drag any segment between them. This contains any number of slides components. Slides help it easy to make galleries, tutorials, and...

2 minutes read.

Ionic Buttons

Ionic Buttons There are different types of buttons in the Ionic framework. These buttons are subtly animated, enhancing the user experience when using the application. Buttons are a fundamental way of interacting and navigating...

4 minutes read.

Ionic framework Installation

Installation of Ionic Before proceeding with the ionic application, you'll need to install node.js and NPM (Node Package Manager), the code editor, and Ionic CLI. Installation of node.js and NPM These are the primary...

5 minutes read.

Ionic Contents

Ionic Contents The content component provides an easy-to-use content area with some useful ways to control the scrollable region. There should be only one content in one view. Content, along with several other Ionic...

2 minutes read.

Ionic Toggle

The toggle is the same as the HTML checkbox entry, but it looks different and easier to use on a touchscreen device. It is an input component that holds the boolean value. Toggle...

2 minutes read.

Ionic Range

The Range slider lets users choose from a range of values by moving the slider knob. You can accept two knobs, but by default, one-knob controls the range value. Range labels You can put down on...

2 minutes read.

Ionic Infinite Scroll

The infinite scroll permits you to perform an action when the user scrolls a particular content from the bottom or top of the page. When you display the large collection of data...

3 minutes read.

Ionic Popover

The Ionic popover is a small dialog box that displays at the top of the screen. It can be used for anything, but it is usually used for a button, an action,...

4 minutes read.

Ionic progress bar

The ionic progress bar element is a horizontal progress bar used to visualize the progression of operation and activity. You can use the <ion-progress-bar> component to create a progress bar in the ionic...

4 minutes read.

Ionic Actionsheet

Ionic Actionsheet The Action sheet is a dialog box that displays a group of options. It is shown on the top of the application content and must be dismissed manually before the user can resume...

3 minutes read.

Difference between Ionic 4 and Ionic 3

The ionic framework is an open-source platform that is used to develop mobile applications. It is also used to build android applications, desktop applications, iOS, and web applications using web technologies like HTML,...

5 minutes read.

Ionic List

Ionic List The ionic list is created of several rows of items that can contain text, buttons, thumbnails, keys, icons, and more. Lists are one of the essential components in any web or...

4 minutes read.

Ionic Loading

The ionic loader is an overlay that can be used to indicate activity, the user interaction while blocking. The ionic loader shows on the top of the app content, and it can...

5 minutes read.

Ionic-fab Button

Ionic-fab Button The Ionic FABs (Floating Action Buttons) are standard material design compounds. It is a container element that contains one or more fab buttons. They are required to be placed in a fixed position,...

2 minutes read.

Ionic Tutorial for Beginners

What is Ionic? Ionic is an open-source framework that is used for the development of mobile applications. It is also used to build android applications, iOS, applications, desktop applications, and web applications using web...

4 minutes read.

Ionic Alert

Ionic Alert An Alert is a dialog box that presents the users with important information, or it stores the data from the user by using the inputs. Alerts are a great way to provide...

5 minutes read.

Features of Ionic Framework

The Ionic Framework is based on the AngularJS framework that permits a programmer to use a combination of many other programming languages, like HTML5, CSS, and JavaScript. Some of the...

4 minutes read.

Ionic Tabs

The ionic tabs mostly used for mobile navigation. It means that tabs are placed at the top of the display on android devices, while at the bottom on IOS. It does not provide...

2 minutes read.

Ionic Refresher

Refresher means updating the currently showing page so that the user can see the latest view. It is also known as re-loading in web technology. It provides a pull- to-refresh feature on a...

4 minutes read.

Ionic Modal

Ionic modal is displayed as a temporary UI that slides into the screen. The ionic modal is a dialog box that is displayed at the top of the app’s content, and it...

5 minutes read.