Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

ionic button


May 21, 2021 ionic


Table of contents


ionic button

Buttons are an integral part of moving apps, different styles of apps, and require different button styles.

By default, the button appears in the following style: display: inline-block.

<button class="button">
  Default
</button>

<button class="button button-light">
  button-light
</button>

<button class="button button-stable">
  button-stable
</button>

<button class="button button-positive">
  button-positive
</button>

<button class="button button-calm">
  button-calm
</button>

<button class="button button-balanced">
  button-balanced
</button>

<button class="button button-energized">
  button-energized
</button>

<button class="button button-assertive">
  button-assertive
</button>

<button class="button button-royal">
  button-royal
</button>

<button class="button button-dark">
  button-dark
</button>

Try it out . . .

The button-block style button appears as: display: block, which fully fills the width of the parent element and contains the padding of the margin property.

<button class="button button-block button-positive">
  Block Button
</button>

Try it out . . .

Using the button-full class, you can make the button display full width without including the margin padding.

<button class="button button-full button-positive">
  Full Width Block Button
</button>

Try it out . . .


Buttons of different sizes

Button-large is set to a large button and button-small is set to a small button.

<button class="button button-small button-assertive">
  Small Button
</button>
<button class="button button-large button-positive">
  Large Button
</button>

Try it out . . .


No background button

Button-outline sets the background to transparent.

<button class="button button-outline button-positive">
  Outlined Button
</button>

Try it out . . .


No background and border buttons

The button-clear setting button background is transparent and borderless.

<button class="button button-clear button-positive">
  Clear Button
</button>

Try it out . . .


Icon button

We can add icons to the button.

<button class="button">
  <i class="icon ion-loading-c"></i> Loading...
</button>

<button class="button icon-left ion-home">Home</button>

<button class="button icon-left ion-star button-positive">Favorites</button>

<a class="button icon-right ion-chevron-right button-calm">Learn More</a>

<a class="button icon-left ion-chevron-left button-clear button-dark">Back</a>

<button class="button icon ion-gear-a"></button>

<a class="button button-icon icon ion-settings"></a>

<a class="button button-outline icon-right ion-navicon button-balanced">Reorder</a>

Try it out . . .


Add a button to the head/bottom

Buttons can be added to the head/bottom, and the style of the buttons is set according to the head/bottom, so you don't need to add additional styles to the buttons.

<div class="bar bar-header">
  <button class="button icon ion-navicon"></button>
  <h1 class="title">Header Buttons</h1>
  <button class="button">Edit</button>
</div>

Try it out . . .

The button-clear class can set head/bottom buttons without backgrounds and borders.

<div class="bar bar-header">
  <button class="button button-icon icon ion-navicon"></button>
  <div class="h1 title">Header Buttons</div>
  <button class="button button-clear button-positive">Edit</button>
</div>

Try it out . . .


Button bar

We can use the button-bar class to set up the button bar. In the following example, we added a button bar to the header and content.

<div class="button-bar">
  <a class="button">First</a>
  <a class="button">Second</a>
  <a class="button">Third</a>
</div>

Try it out . . .