Boilerplate for creating a custom element.
Перейти к файлу
Jon Rohan 4221bd92ef
Merge pull request #47 from github/dependabot/npm_and_yarn/braces-3.0.3
Bump braces from 3.0.2 to 3.0.3
2024-06-18 16:53:37 -07:00
.devcontainer Add a .devcontainer 2022-02-28 17:04:12 +00:00
.github/workflows Update .github/workflows/accessibility-alt-text-bot.yml 2024-01-08 13:35:51 -08:00
examples Use web-dev-server for local development 2022-04-29 12:43:03 +02:00
src Add description for Custom Element 2022-08-15 11:11:43 +02:00
test Convert the tests to TypeScript 2022-04-29 19:20:51 +02:00
.eslintignore Flow to TypeScript 2020-02-19 22:48:14 -05:00
.eslintrc.json Enable `eslint-plugin-custom-elements` 2021-04-28 08:56:44 +01:00
.gitattributes Create .gitattributes 2021-03-15 10:12:16 +00:00
.gitignore Add set up code 2018-06-25 16:49:41 -04:00
CODEOWNERS move AOR to primer 2022-09-23 18:52:50 +01:00
CODE_OF_CONDUCT.md Add required files 2020-02-19 17:26:27 -05:00
CONTRIBUTING.md Add required files 2020-02-19 17:26:27 -05:00
LICENSE set correct year in LICENSE 2019-05-13 09:56:13 +01:00
README.md Add description for Custom Element 2022-08-15 11:11:43 +02:00
SECURITY.md Add required files 2020-02-19 17:26:27 -05:00
custom-elements-manifest.config.js prettier 2022-11-30 17:28:55 +00:00
custom-elements.json Add description for Custom Element 2022-08-15 11:11:43 +02:00
package-lock.json Bump braces from 3.0.2 to 3.0.3 2024-06-16 09:45:37 +00:00
package.json upgrade all dependencies 2022-11-30 17:26:33 +00:00
tsconfig.json Convert the tests to TypeScript 2022-04-29 19:20:51 +02:00
vscode.html-custom-data.json Add description for Custom Element 2022-08-15 11:11:43 +02:00
web-dev-server.config.js prettier 2022-11-30 17:28:55 +00:00
web-test-runner.config.js prettier 2022-11-30 17:28:55 +00:00

README.md

<custom-element> element

Boilerplate for creating a custom element.

Installation

Available on npm as @github/custom-element-element.

$ npm install --save @github/custom-element-element

Usage

Script

Import as ES modules:

import '@github/custom-element-element'

Include with a script tag:

<script type="module" src="./node_modules/@github/custom-element-element/dist/index.js">

An example Custom Element. This documentation ends up in the README so describe how this elements works here.

You can event add examples on the element is used with Markdown.

<custom-element></custom-element>

Browser support

Browsers without native custom element support require a polyfill.

  • Chrome
  • Firefox
  • Safari
  • Microsoft Edge

License

Distributed under the MIT license. See LICENSE for details.