@politico/vue-accessible-selects
vue-accessible-selects
Description: Select & Multi Select implementations for Vue, focused especially on implementing accessibility best practices
- Technology stack: Vue 3, Typescript, Vite
- Demo: vue-accessible-selects.netlify.app/
Installation
npm i @politico/vue-accessible-selects
Usage
import { SelectSingle, SelectMulti } from '@politico/vue-accessible-selects'
const sampleOptions = [{
label: 'One Option',
value: 'one_option'
}, {
label: 'Another Option',
value: 'another_option'
}]
export default {
components: { SelectSingle, SelectMulti },
data() {
return {
sampleOptions,
selectSingleValue: {},
selectMultiValues: []
}
},
}
<SelectSingle
v-model="selectSingleValue"
:options="sampleOptions"
label="My Single Select"
:labelIsVisible="true"
/>
<SelectMulti
v-model="selectMultiValues"
:options="sampleOptions"
label="My Multiple Select"
:labelIsVisible="true"
placeholder="Default Text to Display"
/>
Custom Styling
Most-commonly externally-referenced classes:
.combo-input.combo-menu
References
- Guiding blogpost: https://www.24a11y.com/2019/select-your-poison-part-2/
- Codepen from above blogpost: https://codepen.io/smhigley/pen/gObMVzv
- #1 ≈ SelectSingle
- #3 ≈ SelectMulti
- Select single implementation: https://github.com/microsoft/sonder-ui/tree/master/src/components/select
- Select multiple implementation: https://github.com/microsoft/sonder-ui/tree/master/src/components/multiselect
WARNING! node-sass deprecated
To compile scss code you must use dart sass package as it uses sass:math module for divisions instead of slash https://sass-lang.com/documentation/breaking-changes/slash-div
node-sass is deprecated
// In any .scss file
// Simple, use default styles provided by lib
// Require `NodePackageImporter` importer for importing this way
// https://sass-lang.com/documentation/js-api/classes/nodepackageimporter/
@use 'pkg:@politico/vue-accessible-selects/styles' as *;
@include selects();
@include select-single();
@include select-multi();
for more detailed implementations, checkout the docs site
Related Packages
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 3.3.2 | 3.x | MIT | |
| 3.2.2 | 3.x | MIT | |
| 3.2.1 | 3.x | MIT | |
| 3.2.0 | 3.x | MIT | |
| 3.0.1 | 3.x | MIT | |
| 3.0.0 | 3.x | MIT | |
| 1.9.4 | 2.x | MIT | |
| 1.9.3 | 2.x | MIT | |
| 1.9.2 | 2.x | MIT | |
| 1.9.1 | 2.x | MIT | |
| 1.9.0 | 2.x | MIT | |
| 1.8.8 | 2.x | MIT | |
| 1.8.7 | 2.x | MIT | |
| 1.8.6 | 2.x | MIT | |
| 1.8.5 | 2.x | MIT | |
| 1.8.4 | 2.x | MIT | |
| 1.8.3 | 2.x | MIT | |
| 1.8.1 | 2.x | MIT | |
| 1.8.0 | 2.x | MIT | |
| 1.7.0 | 2.x | MIT | |
| 1.6.0 | 2.x | MIT | |
| 1.5.0 | 2.x | MIT | |
| 1.4.0 | 2.x | MIT | |
| 1.3.0 | 2.x | MIT | |
| 1.1.6 | 2.x | MIT | |
| 1.1.5 | 2.x | MIT | |
| 1.1.4 | 2.x | MIT | |
| 1.1.3 | 2.x | MIT | |
| 1.1.2 | 2.x | MIT | |
| 1.1.0 | 2.x | MIT |
Showing the latest 30 of 62. See every release on npm
Pre-releases (50)
| Version | Released | Vue | License |
|---|---|---|---|
| 2.0.1-alpha.32 | 3.x | MIT | |
| 2.0.1-alpha.31 | 3.x | MIT | |
| 2.0.1-alpha.30 | 3.x | MIT | |
| 2.0.1-alpha.29 | 3.x | MIT | |
| 2.0.1-alpha.28 | 3.x | MIT | |
| 2.0.1-alpha.27 | 3.x | MIT | |
| 2.0.1-alpha.26 | 3.x | MIT | |
| 2.0.1-alpha.25 | 3.x | MIT | |
| 2.0.1-alpha.24 | 3.x | MIT | |
| 2.0.1-alpha.23 | 3.x | MIT | |
| 2.0.1-alpha.22 | 3.x | MIT | |
| 2.0.1-alpha.20 | 3.x | MIT | |
| 2.0.1-alpha.19 | 3.x | MIT | |
| 2.0.1-alpha.18 | 3.x | MIT | |
| 2.0.1-alpha.17 | 3.x | MIT | |
| 2.0.1-alpha.16 | 3.x | MIT | |
| 2.0.1-alpha.15 | 3.x | MIT | |
| 2.0.1-alpha.14 | 3.x | MIT | |
| 2.0.1-alpha.13 | 3.x | MIT | |
| 2.0.1-alpha.12 | 3.x | MIT | |
| 2.0.1-alpha.11 | 3.x | MIT | |
| 2.0.1-alpha.10 | 3.x | MIT | |
| 2.0.1-alpha.9 | 3.x | MIT | |
| 2.0.1-alpha.8 | 3.x | MIT | |
| 2.0.1-alpha.7 | 3.x | MIT | |
| 2.0.1-alpha.6 | 3.x | MIT | |
| 2.0.1-alpha.5 | 3.x | MIT | |
| 2.0.1-alpha.4 | 3.x | MIT | |
| 2.0.1-alpha.3 | 3.x | MIT | |
| 2.0.1-alpha.2 | 3.x | MIT |
Showing the latest 30 of 50. See every release on npm