https://github.com/flatmax/web-lit-component
Infrastructure for a web component based on lit
https://github.com/flatmax/web-lit-component
Last synced: 4 months ago
JSON representation
Infrastructure for a web component based on lit
- Host: GitHub
- URL: https://github.com/flatmax/web-lit-component
- Owner: flatmax
- License: mit
- Created: 2022-09-05T23:19:08.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-06T03:32:14.000Z (almost 4 years ago)
- Last Synced: 2025-09-16T21:53:57.650Z (9 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# \
Basic infrastructure for Lit web components. Use this repo to start a new webcomponent.
Steps to create your own web component based on Lit :
* Choose a name for your component : I will choose VanillaLit (vanilla-lit)
* Clone the repo : ```git clone git@github.com:flatmax/web-lit-component.git```
* Rename the repo : ```mv web-lit-component vanilla-lit```
* Rename some files in the repo :
* mv web-lit-component.js vanilla-lit.js
* mv src/WebLitComponent.js src/VanillaLit.js
* Find and replace the component name :
* Replace "WebLitComponent" for "VanillaLit"
* Replace "web-lit-component" for "vanilla-lit"
## Local Demo with `web-dev-server`
```bash
npm start
```
To run a local development server that serves the basic demo located in `demo/index.html`
## Usage
```html
import 'web-lit-component/web-lit-component.js';
```