mantine: 基本框架搭建/安装/使用

一个前端组件库的安装使用
更新于: 2024-04-23 06:00:00

基本项目

bun create react/react-ts --no-git --no-install

安装mantine

yarn add @mantine/core @mantine/hooks

App.tsx 配置

import { createTheme, MantineProvider } from '@mantine/core';

const theme = createTheme({
  /** Put your mantine theme override here */
});

function Demo() {
  return (
    <MantineProvider theme={theme}>
      {/* Your app here */}
    </MantineProvider>
  );
}

引入sass

// core styles are required for all packages
import '@mantine/core/styles.css';

// other css files are required only if
// you are using components from the corresponding package
// import '@mantine/dates/styles.css';
// import '@mantine/dropzone/styles.css';
// import '@mantine/code-highlight/styles.css';
// ...

参考