NativeUI Primitives

Getting Started

Welcome to NativeUI Primitives documentation

Introduction

NativeUI Primitives is a collection of low-level UI primitives for building cross-platform design systems that work seamlessly across iOS, Android, and Web with a unified API.

Installation

npm install @native-ui-org/primitives
pnpm add @native-ui-org/primitives
yarn add @native-ui-org/primitives
bun add @native-ui-org/primitives

Philosophy

  • Unstyled by default - Full control over styling
  • Accessible - ARIA support and semantic HTML on web
  • Cross-platform - Write once, run everywhere
  • Type-safe - Full TypeScript support
  • Minimal - Small bundle size, zero dependencies

Available Primitives

Browse the sidebar to explore all available primitives.

Quick Example

import { View, Text, showAlert } from '@native-ui-org/primitives';

function MyComponent() {
  const handlePress = async () => {
    const result = await showAlert({
      title: 'Confirm',
      message: 'Are you sure?',
      buttons: [
        { text: 'Cancel', value: 'cancel', style: 'cancel' },
        { text: 'OK', value: 'ok' }
      ]
    });
    
    console.log('Result:', result);
  };

  return (
    <View>
      <Text as="h1">Hello World</Text>
      <button onPress={handlePress}>Show Alert</button>
    </View>
  );
}

Next Steps

  • Explore the View primitive
  • Learn about Text rendering
  • Try the interactive Preview demos