Calcite Components is a rich library of flexible, framework-agnostic web components for building web applications. Explore the Web concepts page to learn about the building blocks of Calcite Design System.
View the component documentation for examples, and API reference, which includes properties, slots, styles, events, and modes. Follow the steps below to get started using Calcite Components.
First, an ArcGIS account is required to use Calcite Components. If you don't have an account, you can create one for free!
Next, load Calcite Components using the content delivery network (CDN) or Node package manager (NPM) library.
Use the CDN
The most common approach for loading Calcite Components is to use the version hosted on the ArcGIS CDN. The components can be loaded by placing a <script
tag in the head of your HTML document:
<script type="module" src="https://js.arcgis.com/calcite-components/3.0.0/calcite.esm.js"></script>
Once the tag is added, components can be used like any other HTML element. Only components that are used in the application will be loaded.
Use the NPM package
Calcite Components is also provided as an NPM package. To get started, first install the package, then follow the steps below. Alternatively, you can find examples using different frameworks and build tools here.
npm install @esri/calcite-components
Load the assets
Some components, such as calcite-icon
and calcite-date-picker
, rely on static assets. By default, assets are automatically served from the CDN which eliminates the need for manual path configuration in most cases.
If you prefer to host assets locally or need to support offline environments, you can copy the assets to your project’s directory. Ensure the local assets are placed in a directory named assets
to maintain compatibility with component expectations.
For example, you can use the following command to copy assets:
cp -r node_modules/@esri/calcite-components/dist/calcite/assets/* ./public/assets/
Once the assets are in place, set the asset path in your application:
import { setAssetPath } from "@esri/calcite-components";
setAssetPath("/path-to-your-assets/");
Import the styles
Next, load the Cascading Style Sheet (CSS). This is dependent on your framework or build tool, however in many cases you can import the CSS directly in JavaScript:
import "@esri/calcite-components/dist/calcite/calcite.css";
Choose a build
Calcite Components offers two builds to suit different use cases:
Custom Elements build
The Custom Elements build is recommended for projects using frontend frameworks. It allows you to import individual components as needed.
You only need to set an asset path if hosting assets locally or using a custom CDN:
import { setAssetPath } from "@esri/calcite-components/dist/components";
setAssetPath("/path-to-your-assets/");
Then, import the components you need. This will automatically define the custom elements:
import "@esri/calcite-components/components/calcite-button";
import "@esri/calcite-components/components/calcite-icon";
import "@esri/calcite-components/components/calcite-slider";
Distribution build
The Distribution build requires defining custom elements on the global window
object. Like the Custom Elements build, you can choose between using local or CDN-hosted assets.
To use the Distribution build:
import { defineCustomElements } from "@esri/calcite-components/loader";
// CDN hosted assets (default)
defineCustomElements();
// Or, for local assets:
// defineCustomElements({ resourcesUrl: "/path-to-your-assets/" });
This approach does not require importing individual components, as all components are registered globally.
Set up TypeScript
Refer to the TypeScript section of the Framework integration resource page for guidance on setting up TypeScript.