Edit page

Customizing Calcite React

Extending Components

You can extend Calcite React components using the syntax provided by Styled Components. CSS properties will override the defaults on the Calcite React component.

Using Theme Variables

As part of extending Calcite React components, you also gain access to the full Theme Object. This includes colors, baseline measurements, border-radius, etc.

Custom Props

You can also conditionally add styles based on props you pass into your new custom component.

as Polymorphic Property

If you want to keep all the styling you've applied to a component but just switch out what's being ultimately rendered (be it a different HTML tag or a different custom component), you can use the as prop to do this at runtime.

Customizing the Theme

Limited theming is possible with Calcite React by extending the Theme Object before passing it into the <CalciteThemeProvider />. Support for more robust theming is on our roadmap.