@brightspace-ui-labs/view-toggle

1.1.0 • Public • Published

d2l-labs-view-toggle

NPM version

Note: this is a "labs" component. While functional, these tasks are prerequisites to promotion to BrightspaceUI "official" status:

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @brightspace-ui-labs/view-toggle

Weekly Downloads

136

Version

1.1.0

License

Apache-2.0

Unpacked Size

18 kB

Total Files

4

Last publish

Collaborators

  • d2l-travis-deploy
  • dlockhart
  • dave.batiste