mirror of
https://github.com/HackPlan/UUI.git
synced 2026-01-13 07:09:35 +08:00
1.2 KiB
1.2 KiB
Getting started
Installing UUI
- Install package ant its peer dependencies with an NPM client like
npmoryarn, pulling in all relevant dependencies:
yarn add @hackplan/uui react react-dom
- After installation, you will be able to import UUI components in your React web application:
import { Button } from '@hackplan/uui';
// using JSX
const button1 = <Button>Click me!</Button>;
// using React.createElement
const button2 = React.createElement(Button, { styling: { type: 'primary' } }, "Click me!");
- Don't forget to include css style file! Besides, UUI package also provide Sass source style files, you can find it in
lib/styles.
// using node-style package resolution in a CSS file
@import '@hackplan/uui/lib/index.css';
TypeScript
UUI is written in TypeScript and therefore its *.d.ts type definitions are bundled in the NPM package, should be used automatically by the compiler. However, you'll need to install typings for UUI's dependencies before you can consume it:
yarn add @types/react @types/react-dom