New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@divetool/coral

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@divetool/coral

Web components for the Coral Design System 🪸

  • 0.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source
WebComponents.org Logo Coral logo

CI NPM Version

Coral Vanilla Web Components

The Coral's web components are built using StencilJS. Read more about it in the StencilJS website.

Documentation

Read the full docs at https://divetool.github.io/coral

Getting started

You can start using Coral's web components via 2 methods.

Using the npm module

Install the @divetool/coral package

npm install @divetool/coral

Define Coral components to be used as web-components in your HTML

import { defineCustomElements, applyPolyfills } from '@divetool/coral/loader';

// Define all Coral custom elements
defineCustomElements();

// Or if you need pollyfills to work with custom elements:
applyPolyfills().then(() => {
  defineCustomElements();
});

You can also define a single component:

import { defineCustomElement as defineCrlButton } from '@divetool/coral/dist/components/crl-button';

// Define CrlButton component
defineCrlButton();

In your HTML:

<html>
  <body>
    <crl-button>Click me</crl-button>
  </body>
</html>

Script tag or native ESmodule

You can load Coral web components in a website/application by adding the following script tag:

Unpkg CDN:

<script
  type="module"
  src="https://unpkg.com/@divetool/coral/dist/coral/coral.esm.js"
  defer
></script>

jsDelivr CDN:

<script
  type="module"
  src="https://cdn.jsdelivr.net/npm/@divetool/coral/dist/coral/coral.esm.js"
  defer
></script>

Your HTML will look similar to this

<html>
  <head>
    <script
      type="module"
      src="https://unpkg.com/@divetool/coral/dist/coral/coral.esm.js"
      defer
    ></script>
  </head>
  <body>
    <crl-button>Click me</crl-button>
  </body>
</html>

Alternatively, if you wanted to take advantage of ES Modules, you could include the components using an import statement:

<html>
  <head>
    <script type="module">
      import { defineCustomElements } from 'https://unpkg.com/@divetool/coral/loader/index.js';
      defineCustomElements();
    </script>
  </head>
  <body>
    <crl-button>Click me</crl-button>
  </body>
</html>

License

This project is licensed under the MIT License.

See LICENSE for more information.

Keywords

FAQs

Package last updated on 11 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc