UI

View on Githubarrow-up-right

circle-exclamation
Package
Version
Downloads

A set of UI elements to build CARTO for React applications.

The package includes 2 main elements: a set of values to use a Material UI theme with CARTO brand (cartoThemeOptions) + a group of widgets:

This package, @carto/react-ui contains the user interface components for the widgets and the @carto/react-widgets package contains the widgets business logic. The UI is decoupled from the business logic so you can provide your own user interface or modify the business logic.

To get information about the different properties available for each of the widgets, please access our Storybook cataloguearrow-up-right, an interactive tool for documenting our Material UI theme and the additional components we have built.

Constants & enums

cartoThemeOptions

A tree of configuration elements (colors, font sizes, families…) to define a theme. See official doc on theming at Material UI themingarrow-up-right

  • Example for v1.5 (MaterialUI 4)

From v2.x, not just the cartoThemeOptions object is exported, but the fully created theme, including our recommended set up for responsive mode. I means that using it, without customization should be as easy as this

  • Example for v1.5 (MUI 5)

LEGEND_TYPES

Constants for the different legend types available.

  • Options:

    • CATEGORY. Use this type when you are visualizing a choropleth map based on the value of a string property.

    • ICON. Use this type when you are visualizing a point layer using icons.

    • CONTINUOUS_RAMP. Use this type when you are visualizing a layer using a continuous color ramp based on a numeric property.

    • BINS. Use this type when you are visualizing a layer assigning colors to bins/intervals based on a numeric property.

    • PROPORTION. Use this type when you are visualizing a point layer using proportional symbols (size-varying).

    • CUSTOM. Use this type when you have a custom visualization that does not fit with the other legend types. It allows you to provide your own legend component.

  • Example:

Last updated

Was this helpful?