Button

Button Props

NameTypeDefaultDescription

clear

boolean

undefined

Makes button in clear style (without fill color). Overwrites clearIos and clearMaterial props

clearIos

boolean

false

Makes button in clear style (without fill color) in iOS theme

clearMaterial

boolean

false

Makes button in clear style (without fill color) in Material theme

colors

object

Object with Tailwind CSS colors classes

colors.activeBgIos

string

'active:bg-primary'

colors.activeBgMaterial

string

''

colors.disabledBg

string

'bg-black bg-opacity-10 dark:bg-white dark:bg-opacity-10'

colors.disabledBorder

string

'border-black border-opacity-10 dark:border-white dark:border-opacity-10'

colors.disabledText

string

'text-black text-opacity-30 dark:text-white dark:text-opacity-30'

colors.fillActiveBgIos

string

'active:bg-ios-primary-shade'

colors.fillActiveBgMaterial

string

''

colors.fillBgIos

string

'bg-primary'

colors.fillBgMaterial

string

'bg-md-light-primary dark:bg-md-dark-primary'

colors.fillTextIos

string

'text-white'

colors.fillTextMaterial

string

'text-md-light-on-primary dark:text-md-dark-on-primary'

colors.fillTouchRipple

string

'touch-ripple-white dark:touch-ripple-primary'

colors.outlineBorderIos

string

'border-primary'

colors.outlineBorderMaterial

string

'border-md-light-outline dark:border-md-dark-outline'

colors.textIos

string

'text-primary'

colors.textMaterial

string

'text-md-light-primary dark:text-md-dark-primary'

colors.tonalBgIos

string

'bg-primary'

colors.tonalBgMaterial

string

'bg-md-light-secondary-container dark:bg-md-dark-secondary-container'

colors.tonalTextIos

string

'text-primary'

colors.tonalTextMaterial

string

'text-md-light-on-secondary-container dark:text-md-dark-on-secondary-container'

colors.touchRipple

string

'touch-ripple-primary'

component

string

'button'

Component's HTML Element

disabled

boolean

false

Makes button disabled

href

string

Link's href attribute, when specified will also be rendered as <a> element

inline

boolean

false

Makes button inline (e.g. display: inline-flex)

large

boolean

undefined

Makes button large. Overwrites largeIos and largeMaterial props

largeIos

boolean

false

Makes button large in iOS theme

largeMaterial

boolean

false

Makes button large in Material theme

outline

boolean

undefined

Makes button outline. Overwrites outlineIos and outlineMaterial props

outlineIos

boolean

false

Makes button outline in iOS theme

outlineMaterial

boolean

false

Makes button outline in Material theme

raised

boolean

undefined

Makes button raised (with shadow). Overwrites raisedIos and raisedMaterial props

raisedIos

boolean

false

Makes button raised (with shadow) in iOS theme

raisedMaterial

boolean

false

Makes button raised (with shadow) in Material theme

rounded

boolean

undefined

Makes button rounded. Overwrites roundedIos and roundedMaterial props

roundedIos

boolean

false

Makes button rounded in iOS theme

roundedMaterial

boolean

false

Makes button rounded in Material theme

segmented

boolean

false

Renders segmented button, same as <SegmentedButton>

segmentedActive

boolean

false

Renders segmented active button, same as <SegmentedButton active>

segmentedStrong

boolean

false

Renders segmented strong button, same as <SegmentedButton strong>

small

boolean

undefined

Makes button small. Overwrites smallIos and smallMaterial props

smallIos

boolean

false

Makes button small in iOS theme

smallMaterial

boolean

false

Makes button small in Material theme

tonal

boolean

undefined

Makes button in tonal style (with semitransparent fill color). Overwrites tonalIos and tonalMaterial props

tonalIos

boolean

false

Makes button in tonal style (with semitransparent fill color) in iOS theme

tonalMaterial

boolean

false

Makes button in tonal style (with semitransparent fill color) in Material theme

touchRipple

boolean

true

Enables touch ripple effect in Material theme

Examples

<template>
  <i-page>
    <i-navbar title="Buttons" />

    <i-block-title>Default Buttons</i-block-title>
    <i-block strong outline-ios class="space-y-2">
      <div class="grid grid-cols-3 gap-x-4">
        <i-button>Button</i-button>
        <i-button class="k-color-brand-red"> Button </i-button>
        <i-button>Button</i-button>
      </div>
      <div class="grid grid-cols-3 gap-x-4">
        <i-button outline>Outline</i-button>
        <i-button class="k-color-brand-red" outline> Outline </i-button>
        <i-button outline>Outline</i-button>
      </div>
      <div class="grid grid-cols-3 gap-x-4">
        <i-button clear>Clear</i-button>
        <i-button class="k-color-brand-red" clear> Clear </i-button>
        <i-button clear>Clear</i-button>
      </div>
      <div class="grid grid-cols-3 gap-x-4">
        <i-button tonal>Tonal</i-button>
        <i-button class="k-color-brand-red" tonal> Tonal </i-button>
        <i-button tonal>Tonal</i-button>
      </div>
    </i-block>

    <i-block-title>Rounded Buttons</i-block-title>
    <i-block strong outline-ios class="space-y-2">
      <div class="grid grid-cols-3 gap-x-4">
        <i-button rounded>Button</i-button>
        <i-button rounded class="k-color-brand-green">Button</i-button>
        <i-button rounded>Button</i-button>
      </div>
      <div class="grid grid-cols-3 gap-x-4">
        <i-button rounded outline> Outline </i-button>
        <i-button rounded outline class="k-color-brand-green">
          Outline
        </i-button>
        <i-button rounded outline> Outline </i-button>
      </div>
      <div class="grid grid-cols-3 gap-x-4">
        <i-button rounded clear> Clear </i-button>
        <i-button rounded clear class="k-color-brand-green"> Clear </i-button>
        <i-button rounded clear> Clear </i-button>
      </div>
    </i-block>

    <i-block-title>Large Buttons</i-block-title>
    <i-block strong outline-ios class="space-y-2">
      <div class="grid grid-cols-3 gap-x-4">
        <i-button large>Button</i-button>
        <i-button large class="k-color-brand-yellow">Button</i-button>
        <i-button large rounded> Button </i-button>
      </div>
      <div class="grid grid-cols-3 gap-x-4">
        <i-button large outline> Outline </i-button>
        <i-button large outline class="k-color-brand-yellow">
          Outline
        </i-button>
        <i-button large rounded outline> Outline </i-button>
      </div>
      <div class="grid grid-cols-3 gap-x-4">
        <i-button large clear> Clear </i-button>
        <i-button large clear class="k-color-brand-yellow"> Clear </i-button>
        <i-button large rounded clear> Clear </i-button>
      </div>
    </i-block>

    <i-block-title>Small Buttons</i-block-title>
    <i-block strong outline-ios class="space-y-2">
      <div class="grid grid-cols-3 gap-x-4">
        <i-button small>Button</i-button>
        <i-button small>Button</i-button>
        <i-button small rounded> Button </i-button>
      </div>
      <div class="grid grid-cols-3 gap-x-4">
        <i-button small outline> Outline </i-button>
        <i-button small outline> Outline </i-button>
        <i-button small rounded outline> Outline </i-button>
      </div>
      <div class="grid grid-cols-3 gap-x-4">
        <i-button small clear> Clear </i-button>
        <i-button small clear> Clear </i-button>
        <i-button small rounded clear> Clear </i-button>
      </div>
    </i-block>

    <i-block-title>Raised Buttons</i-block-title>
    <i-block strong outline-ios class="space-y-2">
      <div class="grid grid-cols-3 gap-x-4">
        <i-button raised>Button</i-button>
        <i-button raised>Button</i-button>
        <i-button raised rounded> Button </i-button>
      </div>
      <div class="grid grid-cols-3 gap-x-4">
        <i-button raised outline> Outline </i-button>
        <i-button raised outline> Outline </i-button>
        <i-button raised rounded outline> Outline </i-button>
      </div>
      <div class="grid grid-cols-3 gap-x-4">
        <i-button raised clear> Clear </i-button>
        <i-button raised clear> Clear </i-button>
        <i-button raised rounded clear> Clear </i-button>
      </div>
    </i-block>

    <i-block-title>Disabled Buttons</i-block-title>
    <i-block strong outline-ios class="space-y-2">
      <div class="grid grid-cols-3 gap-x-4">
        <i-button disabled>Button</i-button>
        <i-button disabled outline>Outline</i-button>
        <i-button disabled clear>Clear</i-button>
      </div>
    </i-block>
  </i-page>
</template>
<script>
  import {
    iPage,
    iNavbar,
    iNavbarBackLink,
    iButton,
    iBlock,
    iBlockTitle,
  } from 'ina-ui/vue';

  export default {
    components: {
      iPage,
      iNavbar,
      iNavbarBackLink,
      iButton,
      iBlock,
      iBlockTitle,
    },

  };
</script>

Last updated