kopia lustrzana https://github.com/shoelace-style/shoelace
add labels examples
rodzic
a2851370bb
commit
88cba353c0
|
@ -20,10 +20,18 @@ Use the `--height` custom property to set the progress bar's height.
|
||||||
|
|
||||||
### Labels
|
### Labels
|
||||||
|
|
||||||
Use the default slot to show a label.
|
Use the `label` attribute to label the progress bar and tell assistive devices how to announce it.
|
||||||
|
|
||||||
```html preview
|
```html preview
|
||||||
<sl-progress-bar value="50" class="progress-bar-labels">50%</sl-progress-bar>
|
<sl-progress-bar value="50" label="Upload progress"></sl-progress-bar>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Showing Values
|
||||||
|
|
||||||
|
Use the default slot to show a value.
|
||||||
|
|
||||||
|
```html preview
|
||||||
|
<sl-progress-bar value="50" class="progress-bar-values">50%</sl-progress-bar>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
@ -31,7 +39,7 @@ Use the default slot to show a label.
|
||||||
<sl-button circle><sl-icon name="plus"></sl-icon></sl-button>
|
<sl-button circle><sl-icon name="plus"></sl-icon></sl-button>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const progressBar = document.querySelector('.progress-bar-labels');
|
const progressBar = document.querySelector('.progress-bar-values');
|
||||||
const subtractButton = progressBar.nextElementSibling.nextElementSibling;
|
const subtractButton = progressBar.nextElementSibling.nextElementSibling;
|
||||||
const addButton = subtractButton.nextElementSibling;
|
const addButton = subtractButton.nextElementSibling;
|
||||||
|
|
||||||
|
|
|
@ -42,10 +42,18 @@ To change the color, use the `--track-color` and `--indicator-color` custom prop
|
||||||
|
|
||||||
### Labels
|
### Labels
|
||||||
|
|
||||||
|
Use the `label` attribute to label the progress ring and tell assistive devices how to announce it.
|
||||||
|
|
||||||
|
```html preview
|
||||||
|
<sl-progress-ring value="50" label="Upload progress"></sl-progress-ring>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Showing Values
|
||||||
|
|
||||||
Use the default slot to show a label.
|
Use the default slot to show a label.
|
||||||
|
|
||||||
```html preview
|
```html preview
|
||||||
<sl-progress-ring value="50" class="progress-ring-labels" style="margin-bottom: .5rem;">50%</sl-progress-ring>
|
<sl-progress-ring value="50" class="progress-ring-values" style="margin-bottom: .5rem;">50%</sl-progress-ring>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
|
@ -53,7 +61,7 @@ Use the default slot to show a label.
|
||||||
<sl-button circle><sl-icon name="plus"></sl-icon></sl-button>
|
<sl-button circle><sl-icon name="plus"></sl-icon></sl-button>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const progressRing = document.querySelector('.progress-ring-labels');
|
const progressRing = document.querySelector('.progress-ring-values');
|
||||||
const subtractButton = progressRing.nextElementSibling.nextElementSibling;
|
const subtractButton = progressRing.nextElementSibling.nextElementSibling;
|
||||||
const addButton = subtractButton.nextElementSibling;
|
const addButton = subtractButton.nextElementSibling;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "dist/shoelace.js",
|
"main": "dist/shoelace.js",
|
||||||
"module": "dist/shoelace.js",
|
"module": "dist/shoelace.js",
|
||||||
"customElements": "dist/custom-elements.json",
|
"customElements": "docs/dist/custom-elements.json",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"types": "dist/shoelace.d.ts",
|
"types": "dist/shoelace.d.ts",
|
||||||
"files": [
|
"files": [
|
||||||
|
|
Ładowanie…
Reference in New Issue