在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):mlaursen/react-md开源软件地址(OpenSource Url):https://github.com/mlaursen/react-md开源编程语言(OpenSource Language):TypeScript 85.4%开源软件介绍(OpenSource Introduction):react-mdCreate an accessible React application with the material design specifications and Scss.
Highlights/Features
Creating a new project
First use create-react-app to create your project: npx create-react-app my-app
cd my-app
npm start
Or with yarn create react-app my-app
cd my-app
Next, install npm install --save react-md sass Next, create a @use "react-md" as *;
// this will include all the styles from react-md
@include react-md-utils; +import './App.scss';
import logo from './logo.svg';
import './App.css'; Finally, update the <meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
- <body>
+ <body class="rmd-typography"> Once you have the styles, fonts, and font icons setup, you can start creating
components from react-md. It is generally recommended to update your base
import './App.scss';
-import logo from './logo.svg';
-import './App.css';
-
-function App() {
- return (
- <div className="App">
- <header className="App-header">
- <img src={logo} className="App-logo" alt="logo" />
- <p>
- Edit <code>src/App.js</code> and save to reload.
- </p>
- <a
- className="App-link"
- href="https://reactjs.org"
- target="_blank"
- rel="noopener noreferrer">
- Learn React
- </a>
- </header>
- </div>
- );
-}
+import {
+ Configuration,
+ Layout,
+ useLayoutNavigation,
+ Typography,
+ Button,
+} from 'react-md';
+
+// see @react-md/layout package for info on the main navigation
+const routes = {};
+function App() {
+ return (
+ <Configuration>
+ <Layout
+ title="My Title"
+ navHeaderTitle="My Nav Title"
+ treeProps={...useLayoutNavigation(routes, pathname)}
+ >
+ <Typography type="headline-4">Hello, world!</Typography>
+ <Button theme="primary">Example button</Button>
+ </Layout>
+ </Configuration>
+ );
+}
export default App; More information can be found on the documentation site's page about creating projects Library SizeThe base yarn dev-utils libsize
The gzipped UMD bundle sizes are:
- dist/umd/react-md.production.min.js 91.56 kB
- dist/umd/react-md-with-font-icons.production.min.js 203.98 kB
- dist/umd/react-md-with-svg-icons.production.min.js 204.03 kB
The min and max gzipped CSS bundle sizes are:
- themes/react-md.grey-red-700-light.min.css 18.08 kB
- themes/react-md.lime-teal-200-dark.min.css 18.15 kB ContributingPlease read the contributing guidelines if you would like to contribute. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论