An open API service indexing awesome lists of open source software.

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

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/)**

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](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)