GithubHelp home page GithubHelp logo

andrico1234 / component-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from daviddarnes/component-template

0.0 0.0 0.0 31 KB

Template for kicking off a new Web Component

Home Page: https://daviddarnes.github.io/component-template/demo.html

License: MIT License

JavaScript 20.51% HTML 79.49%

component-template's Introduction

component-name

A Web Component for…

Demo | Further reading

Examples

General usage example:

<script type="module" src="component-name.js"></script>

<component-name>
  <button>Button</button>
</component-name>

Example using a fallback method:

<script type="module" src="component-name.js"></script>

<component-name>
  <button>Button</button>
  <a href="#">Anchor</a>
</component-name>
<style>
  component-name:not(:defined) button,
  component-name:defined a {
    display: none;
  }
</style>

Example using options or additional fallback method:

<script type="module" src="component-name.js"></script>

<component-name attribute="value">
  <button>Button</button>
</component-name>
<style>
  component-name[attribute="value"] {
    outline: 1px solid red;
  }
</style>

Features

This Web Component allows you to:

  • Check for…

Installation

You have a few options (choose one of these):

  1. Install via npm: npm install @daviddarnes/component-name
  2. Download the source manually from GitHub into your project.
  3. Skip this step and use the script directly via a 3rd party CDN (not recommended for production use)

Usage

Make sure you include the <script> in your project (choose one of these):

<!-- Host yourself -->
<script type="module" src="component-name.js"></script>
<!-- 3rd party CDN, not recommended for production use -->
<script
  type="module"
  src="https://www.unpkg.com/@daviddarnes/[email protected]/component-name.js"
></script>
<!-- 3rd party CDN, not recommended for production use -->
<script
  type="module"
  src="https://esm.sh/@daviddarnes/[email protected]"
></script>

Credit

With thanks to the following people:

component-template's People

Contributors

daviddarnes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.