Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

1.7 KB
Raw Blame

Custom Theme

You can pass theme name or object used to customize Kepler.gl style. Kepler.gl provide an 'light' theme besides the default 'dark' theme. When pass in a theme object Kepler.gl will use the value passed as input to overwrite values from theme.

import KeplerGl from '@kepler.gl/components';

const Map = props => (
  <KeplerGl
    id="foo"
    width={width}
    mapboxApiAccessToken={token}
    height={height}
    theme="light"
  />
);

Available Themes

theme
dark (default) Screen Shot 2020-03-11 at 2 11 45 PM
light Screen Shot 2020-03-11 at 2 10 15 PM
space Azure surfaces with a blue accent; same layout as dark.
base Screen Shot 2020-03-11 at 2 10 49 PM

Theme Toggle Control

To show a map control that cycles UI themes at runtime, pass the list of theme names. The first name is the default. The switcher is shown only when the list has two or more themes.

import {initApplicationConfig} from '@kepler.gl/utils';

initApplicationConfig({themes: ['dark', 'light', 'space']});

When a list is set, the active theme is stored in uiState.theme and can be initialized through keplerGlReducer.initialState:

keplerGlReducer.initialState({
  uiState: {
    theme: 'light'
  }
});