Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@esri/calcite-components

Package Overview
Dependencies
Maintainers
33
Versions
1423
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@esri/calcite-components

Web Components for Esri's Calcite Design System.

  • 1.0.0-beta.11
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
91K
decreased by-6.67%
Maintainers
33
Weekly downloads
 
Created
Source

Built With Stencil

Calcite Components

Shared Web Components for Esri's Calcite design framework.

Documentation for each component can be found within that component's directory in a generated readme.md file. This file will cover all the events and attributes each component uses.

The current lineup of components is:

  • alerts
  • button
  • loader
  • modal
  • progress
  • radio-group
  • slider
  • switch
  • tabs

Installation

npm install --save @esri/calcite-components

Script tag

Calcite components can be loaded via two <script> tags in the head of your HTML document:

<script type="module" src="https://unpkg.com/@esri/calcite-components@1.0.0-beta.2/dist/calcite/calcite.esm.js"></script>
<script nomodule="" src="https://unpkg.com/@esri/calcite-components@1.0.0-beta.2/dist/calcite/calcite.js"></script>

Browsers that support modules will load the first, while older browsers will load the second, bundled version.

Once these script tags are added, components can be used just like any other HTML element. Only components that are actually used will be loaded.

Webpack

If you already have a webpack build for your project, you can use @stencil/webpack to add calcite-components to your bundle.

After installing calcite-components, install the plugin as a dev dependency:

npm install --save-dev @stencil/webpack

Then import and call the plugin in webpack.config.js:

const stencil = require('@stencil/webpack');
module.exports = {
  ...
  plugins: [
    new stencil.StencilPlugin()
  ]
}

Lastly, add the import in your main bundle js (or ts) file:

import '@esri/calcite-components/dist/calcite.js';

This will add the initial stencil loader to your bundle, and copy over the actual component code to the output directory you've configured for Webpack. Components will still be lazy-loaded as they are needed. Note: you must use the .js file path for the Webpack plugin to work correctly, even if your bundle file is a TypeScript file.

TypeScript

Stencil provides a full set of typings for all the components in this repo. To make TypeScript aware of these components, just import the library:

import '@esri/calcite-components';

This will provide autocomplete of component names/properties, as well as additional HTML element types:

// created elements will implicitly have the correct type already
const loader = document.createElement('calcite-loader');
document.body.appendChild(loader);
loader.isActive = true;

// you can also explicitly type an element using the generated types
// the type name will always be formatted like HTML{CamelCaseComponentName}Element
const loader = document.querySelector('.my-loader-element') as HTMLCalciteLoaderElement;
loader.isActive = true;

Contributing

We welcome contributions to this project. See CONTRIBUTING.md for an overview of contribution guidelines.

License

Apache 2.0. For a full copy of the license, see the LICENSE file.

FAQs

Package last updated on 22 Oct 2019

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