0.0.4-alpha.3 • Published 2 years ago

@xifo/mirai-system v0.0.4-alpha.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

取名自《境界的彼方》女主栗山未来(Kuriyama Mirai)

MIT Last Tag

Mirai UI Mirai UI

安装

要在项目中使用 Mirai UI, 你需要在终端运行以下命令之一

npm i @emotion/react @emotion/styled @xifo/mirai-ui @xifo/mirai-system
yarn add @emotion/react @emotion/styled @xifo/mirai-ui @xifo/mirai-system

Hooks

Mirai 提供了一些实用的 Hook 方法,可以使用以下命令安装

yarn add @xifo/mirai-hooks

Icons

Icon 图标库准备中

## COMING SOON...
## yarn add @xifo/mirai-icons

开始使用

安装好一切后,你需要使用 ThemeProvider 包裹 App 根目录,例如 index.tsx, App.tsx,这都取决于你使用的框架

import * as React from 'react';
import { createTheme, Theme, ThemeProvider } from '@xifo/mirai-system';

const App = () => {
  const theme: Theme = useMemo(() => createTheme({ mode: 'light' }), []);

  return (
    <ThemeProvider theme={theme}>
      <Component />
    </ThemeProvider>
  )
}

export default App