https://github.com/47degrees/codetab
Tab selector web component
https://github.com/47degrees/codetab
code-snippets stenciljs tabs web-component
Last synced: 3 months ago
JSON representation
Tab selector web component
- Host: GitHub
- URL: https://github.com/47degrees/codetab
- Owner: 47degrees
- License: mit
- Created: 2020-03-13T16:48:51.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-13T17:42:32.000Z (over 5 years ago)
- Last Synced: 2025-02-03T14:42:59.742Z (5 months ago)
- Topics: code-snippets, stenciljs, tabs, web-component
- Language: TypeScript
- Size: 111 KB
- Stars: 0
- Watchers: 6
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
 [](https://npmjs.com/package/@47deg/codetab "View this project on npm")
# Codetab
Tab selector web component.
## Preview

## Installation
### Load it from a CDN
- Put a script tag similar to this `` in the head of your `index.html`.
- Then you can use the element anywhere in your template, JSX, html etc.### Host your own instance
- Run `npm install @47deg/codetab --save`.
- Put a script tag similar to this `` in the head of your `index.html`.
- Then you can use the element anywhere in your template, JSX, html etc.### In JS environment app
- Run `npm install @47deg/codetab --save`.
- Add an import to the npm packages `import @47deg/codetab;`.
- Then you can use the element anywhere in your template, JSX, html etc.## Usage
Once loaded on your site, you can simply use it like this:
```html
Scala code snippet
Kotlin code snippet
Swift code snippet
Haskell code snippet
```
Codetab will show one element at a time depending on the tab you have selected. The web component will respect styles associated with those elements, so will happen with any code highlighting, which are responsibility of your website styling.
## Contributing or modifying this web component
Codetab is built with Stencil, a compiler for building fast web apps using Web Components.
Stencil components are just Web Components, so they work in any major framework or with no framework at all. To start playing with it, clone this repo to a new directory:
```bash
git clone https://github.com/47degrees/codetab.git codetab
cd codetab
```and run:
```bash
npm install
npm start
```To build the component for production, run:
```bash
npm run build
```To run the unit tests for the components, run:
```bash
npm test
```Need help? Check out our docs [here](https://stenciljs.com/docs/my-first-component).