@native-mate/core
The runtime package for native-mate. Provides the token system, ThemeProvider, and primitive components used by all registry components.
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/corePeer dependencies
react>= 18.0.0react-native>= 0.73.0react-native-reanimated>= 3.0.0
Exports
Theme
| Export | Description |
|---|---|
| ThemeProvider | Root 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 |
| presets | Object 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:
| Component | Description |
|---|---|
| Text | Themed text with variant presets (h1-h6, body, caption, label, code) |
| Icon | SVG icon wrapper with theme-aware sizing and color |
| Spinner | Animated loading indicator in 3 sizes |
| Separator | Horizontal or vertical divider line |
Utilities
| Export | Description |
|---|---|
| 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>
)
}