A set of React components that wrap calcite components

Usage no npm install needed!

<script type="module">
  import esriCalciteComponentsReact from 'https://cdn.skypack.dev/@esri/calcite-components-react';


Calcite Components React

A set of React components that wrap Calcite Components.


npm install --save @esri/calcite-components-react

This package includes the compatible version of the main component library as a dependency, so no need to install @esri/calcite-components separately.


Much like using the standard calcite-components package, you'll need to define the elements on the window first:

import {
} from "@esri/calcite-components/dist/loader";

// if you're supporting older browsers, apply polyfills
applyPolyfills().then(() => {
  // define the custom tags on the window
  // after these are defined, render your app as you would normally
  ReactDOM.render(<App />, document.getElementById("root"));

To ensure the theme works, import the global stylesheet into your app (only do this once):

import "@esri/calcite-components/dist/calcite/calcite.css";

Then import any components you'd like to use:

import {
} from "@esri/calcite-components-react";

Static Assets

Some components (icon, date-picker) rely on assets being available at a particular path. You'll need to copy these over to your public folder for them to work properly. Something like:

cp -r node_modules/@esri/calcite-components/dist/calcite/assets/* ./public/assets/

Why not just use the web components directly?

Because React uses a synthetic event system, the custom events emitted from calcite components won't work with JSX in React. For example, say you want to update some value when the calcite-slider component changes. When using the standard web components, you need to save a ref to the element, and add a listener:

const sliderEl = useRef(null);
const [sliderValue, setSliderValue] = useState(50);

function onUpdate(event) {

// need to access the dom node to set custom event listeners or props that aren't strings / numbers
// https://stenciljs.com/docs/react#properties-and-events
  (_) => {
    sliderEl.current.addEventListener("calciteSliderUpdate", onUpdate);

Using calcite-components-react, these events are connected for you:

const [sliderValue, setSliderValue] = useState(50);
<CalciteSlider onCalciteSliderUpdate={(e) => setSliderValue(e.target.value)} />;

If you're using TypeScript, you'll also get increased type safety for your event listeners, props, etc.


We welcome contributions to this project. See the main calcite-components CONTRIBUTING.md for an overview of contribution guidelines.


COPYRIGHT © 2021 Esri

All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions.

This material is licensed for use under the Esri Master License Agreement (MLA), and is bound by the terms of that agreement. You may redistribute and use this code without modification, provided you adhere to the terms of the MLA and include this copyright notice.

See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english

For additional information, contact: Environmental Systems Research Institute, Inc. Attn: Contracts and Legal Services Department 380 New York Street Redlands, California, USA 92373 USA

email: contracts@esri.com