https://github.com/daviddarnes/component-template
Template for kicking off a new Web Component
https://github.com/daviddarnes/component-template
component components customelement customelements template template-repository webcomponent webcomponents
Last synced: 12 months ago
JSON representation
Template for kicking off a new Web Component
- Host: GitHub
- URL: https://github.com/daviddarnes/component-template
- Owner: daviddarnes
- License: mit
- Created: 2023-12-08T22:20:59.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-03T15:36:52.000Z (almost 2 years ago)
- Last Synced: 2025-04-12T02:05:20.617Z (12 months ago)
- Topics: component, components, customelement, customelements, template, template-repository, webcomponent, webcomponents
- Language: HTML
- Homepage: https://daviddarnes.github.io/component-template/demo.html
- Size: 35.2 KB
- Stars: 145
- Watchers: 4
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `component-name`
A Web Component for…
**[Demo](https://daviddarnes.github.io/component-template/demo.html)** | **[Further reading](https://darn.es/web-component-github-starter-template/)**
[](https://stackblitz.com/~/github.com/daviddarnes/component-template?file=component-name.js&initialPath=/demo.html)
## Examples
General usage example:
```html
Button
```
Example using a fallback method:
```html
Button
Anchor
component-name:not(:defined) button,
component-name:defined a {
display: none;
}
```
Example using options or additional fallback method:
```html
Button
component-name[attribute="value"] {
outline: 1px solid red;
}
```
## Features
This Web Component allows you to:
- Check for…
## Installation
You have a few options (choose one of these):
1. Install via [npm](https://www.npmjs.com/package/@daviddarnes/component-name): `npm install @daviddarnes/component-name`
1. [Download the source manually from GitHub](https://github.com/daviddarnes/component-name/releases) into your project.
1. Skip this step and use the script directly via a 3rd party CDN (not recommended for production use)
### Usage
Make sure you include the `` in your project (choose one of these):
```html
<!-- Host yourself -->
<script type="module" src="component-name.js">
```
```html
```
```html
```
## Credit
With thanks to the following people:
- [Zach Leatherman](https://zachleat.com) for inspiring this [Web Component repo template](https://github.com/daviddarnes/component-template)