Instalación
Instala Material-UI, el framework de IU para React más popular del mundo.
Material-UI está disponible como un paquete npm .
npm
Para instalarlo y guardarlo en las dependencias de tu package.json
, ejecuta:
// usando npm
npm install @material-ui/core
// usando yarn
yarn add @material-ui/core
Ten en cuenta que react > = 16.8.0 y react-dom > = 16.8.0 son dependencias tipo "peer".
Fuente Roboto
Material-UI fue diseñado con la fuente Roboto en mente. Así que asegúrate de seguir estas instrucciones . Por ejemplo, a través de Google Web Fonts:
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
Fuente de Iconos
In order to use the font Icon
component, you must first add the Material icons font. Aquí hay algunas instrucciones sobre cómo hacerlo. Por ejemplo, a través de Google Web Fonts:
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
Iconos SVG
In order to use prebuilt SVG Material icons, such as those found in the icons demos you must first install the @material-ui/icons package:
// with npm
npm install @material-ui/icons
// with yarn
yarn add @material-ui/icons
CDN
Puedes comenzar a utilizar Material-UI con una infraestructura mínima de front-end, lo que es excelente para la creación de prototipos.
Two Universal Module Definition (UMD) files are provided:
- uno para desarrollo: https://unpkg.com/@material-ui/core@latest/umd/material-ui.development.js
- uno para producción: https://unpkg.com/@material-ui/core@latest/umd/material-ui.production.min.js
Puedes seguir este ejemplo sobre CDN para empezar rápidamente.
⚠️ Using this approach in production is discouraged though - the client has to download the entire library, regardless of which components are actually used, affecting performance and bandwidth utilization.
⚠️ The UMD links are using the latest
tag to point to the latest version of the library. This pointer is unstable, it shifts as we release new versions. You should consider pointing to a specific version, such as v4.4.0.