Zephora UI

Първи стъпки

Zephora UI се доставя като scoped пакети. Инсталирайте React пакета плюс двигателя на темите, импортирайте базовия стилов лист веднъж и композирайте.

Инсталиране

npm install @zephora/react @zephora/theme @zephora/tokens
# React Native
npm install @zephora/native @zephora/theme @zephora/tokens

Употреба

import "@zephora/react/styles.css";
import { Button, Card, CardBody, Input } from "@zephora/react";
import { ThemeProvider, darkTheme } from "@zephora/theme";

export default function App() {
  return (
    <ThemeProvider theme={darkTheme}>
      <Card>
        <CardBody>
          <Input placeholder="Email" />
          <Button>Save</Button>
        </CardBody>
      </Card>
    </ThemeProvider>
  );
}

React Native

import { ZephoraProvider, Button } from "@zephora/native";
import { darkTheme } from "@zephora/theme";

export default function App() {
  return (
    <ZephoraProvider theme={darkTheme}>
      <Button onPress={() => {}}>Save</Button>
    </ZephoraProvider>
  );
}

Tree shaking

Всеки пакет е ESM-first със sideEffects, ограничени до CSS. Импортирайте само това, което използвате; бъндлърите изхвърлят останалото. Gzip бюджетът на компонент (~5KB) се налага в CI със size-limit.