Files
ui/docs/getting-started/installation.md
2025-12-27 18:25:15 +03:00

50 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Installation
## Requirements
- React 18+
- TypeScript 5+ (рекомендуется)
- Vite 5+ (для dev/примера)
## Install
```bash
pnpm add @tria/ui
```
## Import styles
Рекомендуемый способ:
```ts
import "@tria/ui/styles";
```
Альтернатива:
```ts
import "@tria/ui/auto";
```
## First render
```tsx
import React from "react";
import { UIProvider, Button } from "@tria/ui";
export function App() {
return (
<UIProvider config={{ theme: "dark", platform: "web", skin: "ios" }}>
<Button data-variant="primary">Hello Tria</Button>
</UIProvider>
);
}
```
## Monorepo note (pnpm workspaces)
Если `@tria/ui` подключён как workspaceпакет, и вы используете `package.json#exports`,
избегайте deepimports вида `@tria/ui/src/...`. Все публичные сущности должны импортироваться из `@tria/ui`:
`import { TabBar } from "@tria/ui";`
`import { TabBar } from "@tria/ui/src/components/tabbar/TabBar";`