Skip to main content
v3.0.040+ componentsMIT, no Pro tierBenchmarked against 6 libraries

Vajra UI

Design tokens, not class strings.

A typed React Native design system. Style with props you already know, get 40+ components out of the box, and switch themes live, with no compiler and no build step.

MyScreen.tsx
<Box p="s-4" gap="s-3" bg="surface" rounded="r-3">
<Text variant="subheading">Hello</Text>
<Badge label="New" bg="primary" />
<Button label="Get started" onPress={() => {}} />
</Box>

// <Box bg="primry" />
// โœ— Type '"primry"' is not assignable. Did you mean '"primary"'?
Hello
New
Get started

A design system, not a styling dialect

Utility classes give you a vocabulary. Vajra gives you the components, the tokens and the theme, typed and ready to ship.

๐Ÿง 

Nothing new to learn

Style with props: bg="primary", p="s-4", rounded="r-3". No class vocabulary to memorise, and every prop maps to a React Native style, so what you write is what renders on iOS and Android.

๐Ÿ“ฆ

Components included

40+ components for real screens: Button, Input, Select, Modal, Sheet, Toast, Tabs, Accordion and more. Build each one once, with createRecipe for your own variants, instead of rebuilding the same button from class strings on every screen.

๐Ÿ”Œ

No build step

No Babel plugin, no Metro config, no CSS file, no compiler. Install the package, wrap your app in VajraProvider, and start building.

โšก

Fast, with proof

Level with twrnc on variant switches, 2.1โ€“2.5ร— faster than NativeWind and 4โ€“8ร— faster than Tamagui, in an open benchmark you can run yourself. See the numbers.

๐ŸŽฏ

Typed end to end

Every token is a typed union, so bg="primry" fails at compile time with Did you mean "primary"? Your own tokens get the same autocomplete through module augmentation.

๐ŸŽจ

Your brand, live theming

Override colors, spacing, radii and fonts with createVajraTheme, and switch light and dark at runtime. Every component follows the theme, with nothing passed down by hand.

๐Ÿงฌ

Headless core

Every styled component sits on unstyled primitives in @88khp/vajra-core. Use the design system, or drop down a level for full control.

โœ…

Tested and previewed

Covered by Jest and React Native Testing Library, and every component in these docs renders live in your browser through react-native-web.

๐Ÿ†“

Free and MIT

Every component is MIT licensed and free to use in any project. There is no Pro tier and nothing behind a paywall.

Runtime tokens at hand-written speed

Benchmarked against six React Native styling libraries in one run, every one rendering the same card with identical output.

8%from hand-written StyleSheet on variant switches, level with twrnc
2.1โ€“2.5ร—faster than NativeWind on every update
4โ€“8ร—faster than Tamagui, with Tamagui's compiler on

Every card changes variant, 12 times ยท median ms for 100 cards ยท lower is faster

  1. StyleSheet (hand-written)95 ms
  2. Vajra UI 3.0.0103 ms
  3. twrnc 4.16106 ms
  4. styled-components 6.6122.5 ms
  5. NativeWind 4.2257 ms
  6. Tamagui 3.1, runtime422.5 ms
  7. Tamagui 3.1, compiled445.5 ms
JavaScript-side timings under Jest, every library in the same run, each rendering the same card with identical output. Hover a row for its multiple of hand-written StyleSheet.

Two steps to your first screen

No Babel plugin, Metro config or CSS file to set up.

1

Install

npm install @88khp/vajra-ui @88khp/vajra-core react-native-safe-area-context
2

Wrap your app

App.tsx
import { VajraProvider } from '@88khp/vajra-ui';

export default function App() {
return (
<VajraProvider colorScheme="light">
<YourApp />
</VajraProvider>
);
}