ion-label

概要(CONTENTS)

Ionic4项目中我们可以使用Ionic4列表项组件ion-label对项目进行布局。ion-label中有ionic ion-label 用法(Usage) ,ionic ion-label 属性(Properties) ,ionic ion-label 中的CSS 自定义属性等

Label is a wrapper element that can be used in combination with ion-item, ion-input, ion-toggle, and more. The position of the label inside of an item can be inline, fixed, stacked, or floating.

ion-label 用法(Usage)

angular javascript

<ion-label>Labelion-label>


<ion-label color="primary">Primary Labelion-label>
<ion-label color="secondary">Secondary Labelion-label>
<ion-label color="danger">Danger Labelion-label>
<ion-label color="light">Light Labelion-label>
<ion-label color="dark">Dark Labelion-label>


<ion-item>
  <ion-label>Default Itemion-label>
ion-item>

<ion-item text-wrap>
  <ion-label>
    Multi-line text that should wrap when it is too long
    to fit on one line in the item.
  ion-label>
ion-item>


<ion-item>
  <ion-label>Default Inpution-label>
  <ion-input>ion-input>
ion-item>

<ion-item>
  <ion-label position="fixed">Fixedion-label>
  <ion-input>ion-input>
ion-item>

<ion-item>
  <ion-label position="floating">Floatingion-label>
  <ion-input>ion-input>
ion-item>

<ion-item>
  <ion-label position="stacked">Stackedion-label>
  <ion-input>ion-input>
ion-item>

<ion-item>
  <ion-label>Toggleion-label>
  <ion-toggle slot="end" checked>ion-toggle>
ion-item>

<ion-item>
  <ion-checkbox slot="start" checked>ion-checkbox>
  <ion-label>Checkboxion-label>
ion-item>

<ion-label>Labelion-label>


<ion-label color="primary">Primary Labelion-label>
<ion-label color="secondary">Secondary Labelion-label>
<ion-label color="danger">Danger Labelion-label>
<ion-label color="light">Light Labelion-label>
<ion-label color="dark">Dark Labelion-label>


<ion-item>
  <ion-label>Default Itemion-label>
ion-item>

<ion-item text-wrap>
  <ion-label>
    Multi-line text that should wrap when it is too long
    to fit on one line in the item.
  ion-label>
ion-item>


<ion-item>
  <ion-label>Default Inpution-label>
  <ion-input>ion-input>
ion-item>

<ion-item>
  <ion-label position="fixed">Fixedion-label>
  <ion-input>ion-input>
ion-item>

<ion-item>
  <ion-label position="floating">Floatingion-label>
  <ion-input>ion-input>
ion-item>

<ion-item>
  <ion-label position="stacked">Stackedion-label>
  <ion-input>ion-input>
ion-item>

<ion-item>
  <ion-label>Toggleion-label>
  <ion-toggle slot="end" checked>ion-toggle>
ion-item>

<ion-item>
  <ion-checkbox slot="start" checked>ion-checkbox>
  <ion-label>Checkboxion-label>
ion-item>

ion-label 属性(Properties)

color

Description

The color to use from your application's color palette. Default options are: "primary", "secondary", "tertiary", "success", "warning", "danger", "light", "medium", and "dark". For more information on colors, see theming.

Attribute color
Type string | undefined

mode

Description

The mode determines which platform styles to use.

Attribute mode
Type "ios" | "md"

position

Description

The position determines where and how the label behaves inside an item.

Attribute position
Type "fixed" | "floating" | "stacked" | undefined

ion-label中的CSS 自定义属性

Name Description
--color Color of the label