mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 11:17:19 +08:00
docs(label): add usage examples and update readme
This commit is contained in:
@ -1,12 +1,4 @@
|
||||
import {
|
||||
Component,
|
||||
Element,
|
||||
Event,
|
||||
EventEmitter,
|
||||
Method,
|
||||
Prop,
|
||||
Watch
|
||||
} from '@stencil/core';
|
||||
import { Component, Element, Event, EventEmitter, Method, Prop, Watch } from '@stencil/core';
|
||||
import { Color, Mode, StyleEvent } from '../../interface';
|
||||
import { createColorClasses } from '../../utils/theme';
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
# ion-label
|
||||
|
||||
Label is a wrapper element that can be used in combination with `ion-item` and `ion-input`.
|
||||
The position of the label can be controlled to be either stacked, inline, or floating.
|
||||
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.
|
||||
|
||||
|
||||
<!-- Auto Generated Below -->
|
||||
|
54
core/src/components/label/usage/angular.md
Normal file
54
core/src/components/label/usage/angular.md
Normal file
@ -0,0 +1,54 @@
|
||||
```html
|
||||
<!-- Default Label -->
|
||||
<ion-label>Label</ion-label>
|
||||
|
||||
<!-- Label Colors -->
|
||||
<ion-label color="primary">Primary Label</ion-label>
|
||||
<ion-label color="secondary">Secondary Label</ion-label>
|
||||
<ion-label color="danger">Danger Label</ion-label>
|
||||
<ion-label color="light">Light Label</ion-label>
|
||||
<ion-label color="dark">Dark Label</ion-label>
|
||||
|
||||
<!-- Item Labels -->
|
||||
<ion-item>
|
||||
<ion-label>Default Item</ion-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>
|
||||
|
||||
<!-- Input Labels -->
|
||||
<ion-item>
|
||||
<ion-label>Default Input</ion-label>
|
||||
<ion-input></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label position="fixed">Fixed</ion-label>
|
||||
<ion-input></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label position="floating">Floating</ion-label>
|
||||
<ion-input></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Stacked</ion-label>
|
||||
<ion-input></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label>Toggle</ion-label>
|
||||
<ion-toggle slot="end" checked></ion-toggle>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-checkbox slot="start" checked></ion-checkbox>
|
||||
<ion-label>Checkbox</ion-label>
|
||||
</ion-item>
|
||||
```
|
@ -1,24 +1,54 @@
|
||||
```html
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-label>Default</ion-label>
|
||||
<ion-input></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label text-wrap>Wrap label this label just goes on and on and on</ion-label>
|
||||
<ion-input></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="fixed">Fixed</ion-label>
|
||||
<ion-input></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="floating">Floating</ion-label>
|
||||
<ion-input></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Stacked</ion-label>
|
||||
<ion-input></ion-input>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
<!-- Default Label -->
|
||||
<ion-label>Label</ion-label>
|
||||
|
||||
<!-- Label Colors -->
|
||||
<ion-label color="primary">Primary Label</ion-label>
|
||||
<ion-label color="secondary">Secondary Label</ion-label>
|
||||
<ion-label color="danger">Danger Label</ion-label>
|
||||
<ion-label color="light">Light Label</ion-label>
|
||||
<ion-label color="dark">Dark Label</ion-label>
|
||||
|
||||
<!-- Item Labels -->
|
||||
<ion-item>
|
||||
<ion-label>Default Item</ion-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>
|
||||
|
||||
<!-- Input Labels -->
|
||||
<ion-item>
|
||||
<ion-label>Default Input</ion-label>
|
||||
<ion-input></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label position="fixed">Fixed</ion-label>
|
||||
<ion-input></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label position="floating">Floating</ion-label>
|
||||
<ion-input></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Stacked</ion-label>
|
||||
<ion-input></ion-input>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-label>Toggle</ion-label>
|
||||
<ion-toggle slot="end" checked></ion-toggle>
|
||||
</ion-item>
|
||||
|
||||
<ion-item>
|
||||
<ion-checkbox slot="start" checked></ion-checkbox>
|
||||
<ion-label>Checkbox</ion-label>
|
||||
</ion-item>
|
||||
```
|
||||
|
Reference in New Issue
Block a user