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-ով։ Ներմուծեք միայն այն, ինչ օգտագործում եք; bundler-ները մնացյալը հեռացնում են։ Յուրաքանչյուր բաղադրիչի gzip բյուջեն (~5KB) վերահսկվում է CI-ում size-limit-ով։