×

Ionic Cards

Ionic Cards: Ionic cards are a standard part of the user interface that acts as an entry point for more specific information. These are the best components for displaying information that'll feel user-friendly. It can be a single component but often consists of a header, address, title, and content. <ion-card> is broken up into many sub-components to show this.

There are many sub-components of ionic cards i.e., ion-card-content, ion-card-header, ion-card-title, ion-card-subtitle.

ion-card-content

<ion-card> is the parent component of ion-card-content, and <ion-card-content> adds some content padding. It is suggested to add any text material for a card to be stored in an ion-card-content component.

Ion-card-header

It is a header component of the ion-card, which makes a header for the cards. You can add a header inside the card by using the <ion-card-header> component.

Ion-card-title

It is a child component of the ion-card, which adds the title for the cards. You can add a title inside the card by using the <ion-card-title> component.

Ion-card-subtitle

It is a child component of the ion-card, which adds the subtitles for the cards. You can add a subtitle inside the card by using the <ion-card-subtitle> component.

Example: The below example shows how the ionic card work with its sub-component.


  
  
  Card
  
  
  
  
   
  
  Life goal
  Focus on your goal
  
  
When he can change his inner consciousness to the way he can serve others, and when he makes this the focus of his life, he will be in a position to know the true miracles in his progress towards prosperity.
  
  
   

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

After executing this code

Card images

You can easily add your app pictures inside the cards. The ion-card will give a fixed width and variable height of the image. You can also easily add headers, menus, and other card components with image cards.

You can add the image by using the following syntax:

Example: The below example shows how images work in the ionic card.


  
  
  Card
  
  
   
  
  
“Beautiful things happen when you distance yourself from negativity.”
Achieving a goal “Do something every day to move toward your goal. Get going and keep going. Just do it.”

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

Card images

Cards list

It can contain a list of items. To show a list inside the content, you require to add the <ion-list> component.

Example:

The given below example shows how the list works in the ion-card component.

 <ion-header>
     <ion-toolbar>
       <ion-title>
         Card List
       </ion-title>
     </ion-toolbar>
   </ion-header>
   <ion-card>
       <ion-card-header>
         Explore Nearby
       </ion-card-header>
       <ion-list>
         <p><button ion-item>
           <ion-icon name="cart" item-start color="success"></ion-icon>
           Shopping Button</button></p>
           <p><button ion-item>
           <ion-icon name="cafe" item-start color="warning"></ion-icon>
             Cafe Button</button></p>
             <p><button ion-item>
           <ion-icon name="film" item-start color="danger"></ion-icon>
             movie Button</button></p>
             <p><button ion-item>
           <ion-icon name="medical" item-start color="light"></ion-icon>
           Hospital Button</button></p>
          <p><button ion-item>
               <ion-icon name="planet" item-start color="secondary"></ion-icon>
               Space Button</button></p>
           <p><button ion-item>
           <ion-icon name="beer" item-start color="tertiary"></ion-icon>
           Pub Button</button></p>
       </ion-list>
     </ion-card> 

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

Cards list

Related Topics

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.

History of Ionic

It is a complete open-source platform for hybrid mobile application development created by Ben Sperry, Max Lynch, and Adam Bradley of Drifty Co. in 2013. The first alpha version of the framework was...

2 minutes read.

Ionic Reorder

The Ionic offers the <ion-reorder> component to reordering features. Ionic reorder component adds the Drag and Drop feature to list items, in which the user can change the order of the items. Reorder...

3 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 Editors

Editors are software programs that permit the users to create and edit the text files. In the development field, editors are usually used to create the source code editors that includes many specific...

3 minutes read.

Ionic Geolocation

In today’s time, the mobile location plays an essential role in the mobile application. The Ionic Cordova geolocation plugin provides information about the location of the device, like as latitude and longitude. The...

5 minutes read.

Ionic Splash Screen

The Apache Cordova plugin helps to displays and hides a splash screen during the application launch. The Ionic Splash Screen is similar to a home page on a website. The ionic splash...

2 minutes read.

Ionic Toolbar

A toolbar is a general toolbar that can be used in an application such as a header, sub-header, footer, or even a sub-footer. Because the ion-toolbar is flexbox-dependent, no matter how many toolbars...

3 minutes read.

Ionic Menu

The Ionic menu is the side-menu navigation that can be slide in from the side of the current view. By default, the menu slides in from the left side, but the side...

7 minutes read.

Ionic Select

The Ion Selection component is similar to the HTML <select> element. However, the Ionic Selection component makes it easy for users to categorize and choose the preferred option or other options. You must...

3 minutes read.

Ionic Camera

Hybrid mobile applications can make very quickly, but sometimes it becomes a challenge to get the features that access the hardware such as GPS, storage, file storage, cameras, and networks. Cordova offers plugins...

4 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 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.

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 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...

3 minutes read.

Ionic Checkbox

Ionic Checkbox Ionic Checkbox is nearly the same as a toggle. It can be placed in an ionic element or used as a separate checkbox. It is designed differently for every platform, such...

2 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 vs Apache Cordova

Ionic Vs Apache Cordova Ionic and Cordova are two popular technology going on in the market for mobile application development. The combination of these two technologies creates a development platform that is known as...

3 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 Radio

Ionic Radio The radio button is the type of input component that has a Boolean value. The Ionic radio button has a different pattern on every platform, as well as other Ionic components....

2 minutes read.