@brightspace-ui-labs/view-toggle
v2.0.0
Published
A lit-element component for toggling between views
Downloads
837
Keywords
Readme
d2l-labs-view-toggle
Note: this is a "labs" component. While functional, these tasks are prerequisites to promotion to BrightspaceUI "official" status:
- [ ] Design organization buy-in
- [ ] Architectural sign-off
- [x] Continuous integration
- [x] Cross-browser testing
- [ ] Unit tests (if applicable)
- [ ] Accessibility tests
- [ ] Visual diff tests
- [ ] Localization with Serge (if applicable)
- [ ] Demo page
- [ ] README documentation
A Lit element component for toggling between views.
Installation
To install from NPM:
npm install @brightspace-ui-labs/view-toggle
Usage
<script type="module">
import '@brightspace-ui-labs/view-toggle/view-toggle.js';
</script>
<d2l-view-toggle
toggleOptions='[{"text":"Bananas","val":"overall"},{"text":"Minions","val":"minios"},{"text":"Pyjamas","val":"subject"}]'
text="Toggle: "
></d2l-view-toggle>
Developing, Testing and Contributing
After cloning the repo, run npm install
to install dependencies.
Linting
# eslint and lit-analyzer
npm run lint
# eslint only
npm run lint:eslint
Testing
# lint & run headless unit tests
npm test
# unit tests only
npm run test:headless
# debug or run a subset of local unit tests
npm run test:headless:watch
Running the demos
To start a @web/dev-server that hosts the demo page and tests:
npm start
Versioning and Releasing
This repo is configured to use semantic-release
. Commits prefixed with fix:
and feat:
will trigger patch and minor releases when merged to main
.
To learn how to create major releases and release from maintenance branches, refer to the semantic-release GitHub Action documentation.