-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
144 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
## Implementation | ||
|
||
The slider has a `role` of `slider`, which needs an accessible label. You must provide it using `aria-label`. | ||
|
||
Vivid automatically sets the `aria-valuetext` attribute on the slider. The attribute is read by assistive technology. You can control its format using the `valueTextFormatter` property for a more human-readable value. | ||
|
||
## Resources | ||
|
||
- [Vivid Tabs: Manual accessibility test](https://docs.google.com/spreadsheets/d/15J0sHxVUlmjv7HwT2b0gGNJFP_vsjAByzgRP_4oWYKk/edit?gid=1175911860#gid=1175911860) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
## Connotation | ||
|
||
Use the `connotation` attribute on Slider to control the Slider track. | ||
Below is an example of cta connotation. | ||
|
||
```html preview blocks> | ||
<vwc-slider connotation="cta"></vwc-slider> | ||
``` | ||
|
||
## Markers | ||
|
||
Use `markers` attribute to add tick marks on the slider. | ||
The markers are set by the value of [`step`](./code/#step). | ||
|
||
```html preview blocks | ||
<vwc-slider markers></vwc-slider> | ||
``` | ||
|
||
## Orientation | ||
|
||
The `orientation` attribute controls which axis the Slider is aligned. | ||
Below is an example of vertical alignment. | ||
|
||
<vwc-note connotation="information" icon="info-line"> | ||
<p>When used vertically, the Slider fits the height of its container.</p> | ||
</vwc-note> | ||
|
||
```html preview center 300px | ||
<vwc-slider orientation="vertical"></vwc-slider> | ||
``` | ||
|
||
## Pin | ||
|
||
Use `pin` attribute to display a tooltip on the Slider knob. | ||
Use the [`valueTextFormatter`](/code/#value-text-formatter) member to customize the format of the value. | ||
|
||
```html preview | ||
<vwc-slider pin></vwc-slider> | ||
<vwc-slider orientation="vertical" style="height: 200px" pin></vwc-slider> | ||
|
||
<script> | ||
for (const slider of document.querySelectorAll('vwc-slider')) { | ||
slider.valueTextFormatter = (value) => `${value} units`; | ||
} | ||
</script> | ||
``` | ||
|
||
## Disabled | ||
|
||
The `disabled` attribute disables the Slider. | ||
|
||
```html preview blocks | ||
<vwc-slider disabled></vwc-slider> | ||
``` |