# Install Patine UI

> Install patine-ui in Expo, bare React Native or React Native Web. Zero native code: no linking, pods, rebuild or config plugin.

# Installation

Patine UI is pure JavaScript: one package, with no native linking, pods or rebuilds.

**npm**

```bash
npm install patine-ui
```

**yarn**

```bash
yarn add patine-ui
```

**pnpm**

```bash
pnpm add patine-ui
```

**Expo**

```bash
npx expo install patine-ui
```

That's it. The package is pure JavaScript, so there is:

- no `pod install`
- no native rebuild — it works in **Expo Go**
- no Babel plugin, Metro config or config plugin
- no other dependency (no Reanimated, Gesture Handler or SVG)

Peer dependencies are `react >= 18` and `react-native >= 0.72`, which your app already has.

## Optional: add the theme provider

Every component works with sensible light and dark defaults that follow the OS appearance, and looks native on each platform (iOS, Material on Android, web). To use your brand colours everywhere, or one design on every platform, wrap your app once:

```tsx title="App.tsx"
import { PatineProvider } from 'patine-ui';

export default function App() {
  return (
    <PatineProvider
      theme={{ colors: { primary: '#FF5A5F' } }}
      design="native" // each platform's own look; leave it out for Patine's, or pick 'ios' | 'material' | 'web'
    >
      <RootNavigator />
    </PatineProvider>
  );
}
```

See [Theming](../guides/theming) for every token and [Designs](../guides/designs) for the looks.

## React Native Web

Nothing extra is needed beyond a standard `react-native-web` setup (Expo web already has one). If you bundle manually, alias `react-native` to `react-native-web`:

```js title="webpack.config.js"
module.exports = {
  resolve: { alias: { 'react-native$': 'react-native-web' } },
};
```

This documentation site is itself built this way: every live example is the real library running on React Native Web.

## Importing

Everything is a named export from the package root:

```tsx
import {
  BottomSheet,
  Calendar,
  DatePicker,
  DatePickerSheet,
  DateWheelPicker,
  EmojiPicker,
  EmojiPickerSheet,
  PatineProvider,
  MultiWheelPicker,
  PickerSheet,
  SegmentedControl,
  Select,
  SelectList,
  TimePicker,
  TimePickerSheet,
  WheelPicker,
  WheelPickerSheet,
} from 'patine-ui';
```

The package is marked `sideEffects: false`, so bundlers that tree-shake (web) drop what you don't import. On native, Metro resolves the TypeScript source through the `react-native` export condition.

### Smaller native bundles

Metro doesn't tree-shake, so a root import bundles every picker on iOS and Android, including about 130 KB of emoji data. Import from the feature subpaths instead and Metro only bundles what you use:

```tsx
import { DatePicker, DatePickerSheet } from 'patine-ui/date';
import { Select } from 'patine-ui/select';
import { PatineProvider } from 'patine-ui/core';
```

| Subpath | Exports |
| --- | --- |
| `/wheel` | `WheelPicker`, `MultiWheelPicker`, `WheelPickerSheet`, `WheelPickerField` |
| `/time` | `TimePicker`, `TimeRangePicker`, their sheets and fields, time range utils |
| `/duration` | `DurationPicker`, `DurationPickerSheet`, `DurationPickerField`, `formatDuration` |
| `/date` | `DatePicker`, `DateWheelPicker`, `DatePickerSheet`, `DatePickerField` |
| `/calendar` | `Calendar`, `WeekStrip`, `getRangePresets`, `CALENDAR_MODE` |
| `/month` | `MonthPicker`, `MonthPickerSheet`, `MonthPickerField` |
| `/datetime` | `DateTimePicker`, `DateTimePickerSheet`, `DateTimePickerField` |
| `/select` | `Select`, `SelectList`, `defaultFilter` |
| `/country` | `CountryPicker`, `PhoneField`, country and phone utils |
| `/timezone` | `TimeZonePicker`, time zone utils |
| `/segmented` | `SegmentedControl`, `ChipGroup` |
| `/emoji` | `EmojiPicker`, `EmojiPickerSheet`, `EmojiPickerField`, emoji utils |
| `/color` | `ColorPicker`, `ColorPickerSheet`, `ColorPickerField`, colour utils |
| `/slider` | `Slider` |
| `/rating` | `Rating` |
| `/otp` | `InputOTP` |
| `/action` | `DropdownMenu`, `ActionSheet`, `useActionSheet` |
| `/sheet` | `BottomSheet`, `PickerSheet`, `PickerField`, `useDraft` |
| `/core` | `PatineProvider`, themes, date utils |

Each subpath also exports its types. Subpaths need React Native 0.79+ (Expo SDK 53+), where Metro reads package `exports` by default. On older versions, set `resolver.unstable_enablePackageExports = true` in `metro.config.js` or keep the root import.
