@native-mate/core

The runtime package for native-mate. Provides the token system, ThemeProvider, and primitive components used by all registry components.

View on npm →

Installation

Installed automatically when you run npx native-mate init. You can also install it manually:

bash
1
2
3
4
5
6
7
npm install @native-mate/core

# or
yarn add @native-mate/core

# or
pnpm add @native-mate/core

Peer dependencies

  • react >= 18.0.0
  • react-native >= 0.73.0
  • react-native-reanimated >= 3.0.0

Exports

Theme

ExportDescription
ThemeProviderRoot provider — wraps your app with preset + color scheme
useTheme()Hook — returns the resolved theme tokens
makeStyles(fn)Creates a cached stylesheet factory from theme tokens
presetsObject with all 4 preset token sets (zinc, slate, rose, midnight)
resolveTokens()Resolves a preset + mode into a flat theme object

Primitives

Core also exports 4 primitive components used by other registry components:

ComponentDescription
TextThemed text with variant presets (h1-h6, body, caption, label, code)
IconSVG icon wrapper with theme-aware sizing and color
SpinnerAnimated loading indicator in 3 sizes
SeparatorHorizontal or vertical divider line

Utilities

ExportDescription
shadow(elevation)Cross-platform shadow helper (iOS shadow* + Android elevation)
useBreakpoint()Returns current breakpoint (sm/md/lg/xl) based on window width

Quick start

App.tsx
1
2
3
4
5
6
7
8
9
import { ThemeProvider } from '@native-mate/core'

export default function App() {
  return (
    <ThemeProvider preset="zinc">
      {/* your app */}
    </ThemeProvider>
  )
}