material-ui

How to use rtl layout of material-ui next in react app

我是研究僧i 提交于 2019-12-11 00:57:21
问题 I want to use rtl layout in my react application. I have used material-ui next version to integrate this application. I have used below code to make application layout rtl. Some components work properly in the rtl layout but some components doesn't affected. /** * App.js Layout Start Here */ import React, { Component } from 'react'; import { connect } from 'react-redux'; import classnames from 'classnames'; import { MuiThemeProvider } from 'material-ui/styles'; import {

How to use breakpoints in Theme definition itself

放肆的年华 提交于 2019-12-11 00:48:21
问题 Material-ui allows you to create a nice Theme definition object to override the default Material Design look and feel. However, when you define a Theme, it's sometimes necessary to be able to create a breakpoint based override (mobile, marginTop is 10, desktop, marginTop is 5). Any idea on how to do that. Obviously, since the Theme is not yet defined, you don't have access to theme reference and through that theme.breakpoints 回答1: You can create the default theme ( createMuiTheme without any

next.js & material-ui - getting them to work

喜夏-厌秋 提交于 2019-12-11 00:44:56
问题 I'm giving next.js a spin and I can't get the simplest setup to work. Here's my setup: Relevant libs: "react": "^16.2.0", "react-dom": "^16.2.0", "next": "^4.2.2", "express": "^4.16.2", "next-routes": "^1.2.0", "material-ui": "^0.20.0", server.js const express = require('express') const next = require('next'); const routes = require('./routes'); const port = parseInt(process.env.PORT, 10) || 3000; const dev = process.env.NODE_ENV !== 'production'; const app = next({ dev }); const handler =

Material-UI Drawer with Appbar not working with component syntax

安稳与你 提交于 2019-12-11 00:25:22
问题 I have created a new thread from this one to avoid confusion as someone told me that Leftnav is now Drawer within the Material-UI components. I am still having problems, the first which is the ES7? syntax of the arrow functions shown here. I have changed to the following code with flat links for now to try to understand what is going on: import React, { Component } from 'react' import { Drawer, AppBar, MenuItem} from 'material-ui' import baseTheme from 'material-ui/styles/baseThemes

How to implement custom Tab indicator color in Material-UI v1

≯℡__Kan透↙ 提交于 2019-12-10 23:17:42
问题 I have MUI v1 beta 32 running on a production site, very nicely. Time to update to v1! So far, changes have been very simple. It's mostly been a matter of updating the import tags. But I am running into an issue with my selected <Tab/> indicator. I was using the rootInheritSelected style override in order to apply the color of my choice. How to implement it in v1? 回答1: In the end I found it was much simpler: <Tabs textColor="inherit" fullWidth centered classes={{ indicator: classes.indicator

Center Avatar inside Toolbar with MaterialUI

可紊 提交于 2019-12-10 23:07:14
问题 Is there any way to center Avatar component inside Toolbar with MaterialUI components? <Toolbar> <ToolbarGroup float="right" lastChild> <ToolbarTitle text="Toolbar"/> <Avatar src="images/avatar.jpg"/> </ToolbarGroup> </Toolbar> I have been playing with this few hours without any success. 回答1: Do you mean vertical-alignment or horizontal? Anywho you can use the style attributes to override the default styles. <Toolbar> <ToolbarGroup float="right" lastChild={true}> <ToolbarTitle text="Toolbar"

Change onHover colour of TextField Material-UI v1

此生再无相见时 提交于 2019-12-10 21:49:14
问题 I m unable to change the onHover color of the TextField by overriding the classname. How can I do that? I'm using material UI v1: https://github.com/callemall/material-ui/tree/v1-beta 回答1: TextField is implemented using the Input component, which exposes a class named underline as part of its CSS API. Here is the the current definition of this class from the Input source: underline: { paddingBottom: 2, '&:before': { backgroundColor: theme.palette.input.bottomLine, left: 0, bottom: 0, // Doing

How should material-ui be externalized when bundling with webpack

大城市里の小女人 提交于 2019-12-10 19:14:05
问题 I packed material-ui from material-ui/index.js into material-ui.js for serving it externally. The import statements are like import FlatButton from 'material-ui/FlatButton'; How should webpack be configured to exclude material-ui as external dependency?\ I believe changing imports as this would help in externalizing but have no idea how to deal with material-ui thereafter. import material-ui from 'material-ui' 来源: https://stackoverflow.com/questions/37102609/how-should-material-ui-be

How to increase the font size for the Table component

无人久伴 提交于 2019-12-10 18:43:38
问题 I'm beginning to evaluate material-ui as an alternative for a project and I would like to know what is the recommended way to change the font size for a table. Currently I'm playing with the component's sandbox (available at https://codesandbox.io/s/9onokxxn5w) but I couldn't find what to change in order to enlarge the font size. I tried to change the theme in demo.js adding a fontSize key to the table element, as follows, but it didn't work: const styles = theme => ({ root: { width: '100%',

How to import ReactJS Material UI using a CDN through Webpack's externals?

筅森魡賤 提交于 2019-12-10 18:30:01
问题 The Problem: I'm trying to create a website (web app) with React and Material UI, it's working just fine using npm. But when I try to make them as externals and import them through a CDN instead, I get an error with Material UI (React works fine). My Code: I linked CDNs in index.html like this: <script src="https://unpkg.com/react@16/umd/react.production.min.js"></script> <script src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script> <script src="https://unpkg.com/