Skip to main content
Version: 2.0.0-alpha.19

Theming

Customization is possible on a chart-by-chart basis, but if you have multiple charts, you might want to set some properties globally.

VicoTheme houses default chart colors. Functions like rememberColumnCartesianLayer and rememberLineCartesianLayer use these for their default arguments. You can use ProvideVicoTheme to provide a custom instance. Use vicoTheme to access the provided value (e.g., vicoTheme.textColor).

ProvideVicoTheme(remember(...) { VicoTheme(...) }) { ... }

You can use rememberM2VicoTheme or rememberM3VicoTheme to create a VicoTheme with the colors from your app’s Material Theme. These functions come from the compose-m2 and compose-m3 modules.

ProvideVicoTheme(rememberM2VicoTheme()) { ... }
ProvideVicoTheme(rememberM3VicoTheme()) { ... }

Beyond VicoTheme, to reuse a customized version of a component across multiple charts, you can create a wrapper for the function that creates this component and apply your styling there.