Skip to main content
Anvil2 RN is the native counterpart to AI Kit. Use it for agentic surfaces in React Native apps. Do not apply the Carto theme to an entire screen solely because it contains an AI-powered feature.

Install

Peer requirements: react@>=18 <20, react-native@>=0.81, react-native-svg@^15, and react-native-reanimated@>=3.16 <5. Reanimated is required by Dialog, BottomSheet, and PromptBar.
Or with npm:
Follow the Reanimated installation guide for the Babel plugin.

Provide the Carto theme

Anvil2 RN has no CSS cascade. CartoThemeProvider puts the resolved Carto theme on React context, and components read it with useCartoTheme. Wrap the root of the agentic surface once.
appearance="auto" follows the device color scheme and re-renders when it changes. Use "light" or "dark" to force an appearance. useCartoTheme returns { theme, appearance }. Without a provider, it falls back to the light theme so components still render in isolated stories and tests.

Quick start

Icons

Import icons from @servicetitan/anvil2-icons/react-native, not from the web package root and not from lucide-react-native directly. The allowlist is shared with AI Kit and owned by VizD.

Telemetry

Anvil2RNTelemetryProvider is optional. Without it, instrumented components emit nothing. Mount it around a subtree and pass onInteraction. A component emits only when you also set analyticsId on that instance. meta carries structural values only (an index, a length). Do not put typed text or other user content there.
The handler identity is stable for the provider’s lifetime, so an inline onInteraction does not re-render instrumented consumers. Thrown or rejected handlers are swallowed so telemetry cannot break the UI.

Internationalization

Anvil2 RN has no i18n layer yet. Caller-supplied copy (label, text, and similar) is already in the consumer’s locale. Components do not author default English strings for those slots.

Resources

React Native overview

See how Anvil2 RN docs are organized.

Components

Browse the public component surface.

AI Kit (web)

Read the web kit getting started guide for the matching APIs.

Charts - React Native

Implement ECharts with the React Native charts kit.
Last modified on September 1, 2026