material-ui

How to extend header to the full page width? [duplicate]

心不动则不痛 提交于 2020-02-25 15:49:09
问题 This question already has answers here : Removing body margin in CSS (10 answers) Closed 23 days ago . How can I extend my header to the full page? I have tried margin-left & right but that doesn't work. Header.css background: green; height: 70px; width: 100%; display: flex; justify-content: space-between; margin-bottom: 25px; left: 0; right: 0; } .header-right { float: right; } @media screen and (max-width: 500px) { .header-right { float: none; } } Here's my app.tsx file: const Header = () =

Material Autocomplete does not work with InputProps

你离开我真会死。 提交于 2020-02-25 04:50:26
问题 I am trying to change the border of my TextField that is rendered through my Autocomplete , but when I add the InputProps prop, the Autocomplete no longer renders Chip s <Autocomplete multiple freeSolo options={options} renderTags={(value, { className, onDelete }) => value.map((option, index) => ( <Chip key={index} variant="outlined" data-tag-index={index} tabIndex={-1} label={option} className={className} color="secondary" onDelete={onDelete} /> )) } renderInput={(params) => ( <TextField {..

Difference between @material-ui vs material-ui (without at-sign)

北城余情 提交于 2020-02-24 12:35:07
问题 Just starting (again) with material UI and react. There are two packages material-ui and @material-ui, which is the best starting point (latest) as of 2019-07 timeframe? I think it is npm install @material-ui/core based on ... https://material-ui.com/getting-started/installation/. The GIT repo is at https://github.com/mui-org/material-ui Simple question, hopefully simple answer. Other questions I looked at: Use Create-React-App with Material UI - This answer says to use npm install --save

How to properly set colors on certain elements in Material-ui?

自古美人都是妖i 提交于 2020-02-24 12:09:26
问题 I'm having a bit of difficulties with the theming in Material-UI when it comes to coloring elements. Some elements automatically choose 'theme.palette.main.dark'. I want to know how to force them not to. For instance the TextField and SpeedDial components automatically choose the dark property from the theme. I've tried to just remove the dark property, but than the TextField is black and the text inside the TextField is unreadable. My theme file is configured as following: import

How to change the language for KeyboardDatePicker material ui?

坚强是说给别人听的谎言 提交于 2020-02-24 11:40:32
问题 I am currently using material ui on the web and I use the KeyboardDatePicker API and it works perfectly, but the names of the months and the text of the buttons are shown in English and I want to change them to Spanish. I read the API documentation but I can't find information about it. Anyone know how to change the language? 回答1: Try importing spanish moment locale and then using it in MuiPickersUtilsProvider : import React from "react"; import ReactDOM from "react-dom"; import {

background-image in react component

。_饼干妹妹 提交于 2020-02-23 09:50:52
问题 I'm building a page and I want a material-ui element to have a background image using background-image CSS property. I have googled for it of course, and there are solutions but for some reason I can't see that image. P.S.1: even changing that MUI element to regular hasn't helped me at all. P.S.2: when I'm using inside container it shows, but that's not what I want. UPDATE1: Tried adding height and width to container, still no luck... import React from 'react'; import Paper from 'material-ui

background-image in react component

十年热恋 提交于 2020-02-23 09:50:06
问题 I'm building a page and I want a material-ui element to have a background image using background-image CSS property. I have googled for it of course, and there are solutions but for some reason I can't see that image. P.S.1: even changing that MUI element to regular hasn't helped me at all. P.S.2: when I'm using inside container it shows, but that's not what I want. UPDATE1: Tried adding height and width to container, still no luck... import React from 'react'; import Paper from 'material-ui

Material-UI React using grid spacing overflows the container

别等时光非礼了梦想. 提交于 2020-02-07 00:06:33
问题 I have been developing with react-native a lot and I'm working on reactjs project now using Material-UI. I think I have a bad understanding of the layout so let me go directly to a minimal example. I have this code in App.js import React from 'react'; import { Container, Grid } from '@material-ui/core'; import './App.css'; function App() { return ( <Container style={{ backgroundColor: "lightgray", flexGrow: 1 }} maxWidth="xs"> <Grid container xs={12} spacing={0} style={{ backgroundColor:

What are the valid values for material -ui's Typography component

自作多情 提交于 2020-02-06 18:55:27
问题 I am using Typography component as below. I am not facing any error. But i just want to know whether it is the right value i am passing to component property of typography component. <Typography component="div" style={{ padding: 8 }}> {props.children} </Typography> What are the valid values that can be passed to component property? 回答1: Typography is a fairly simple component. All it does is specify className on the component such that the text is styled appropriately. Your sample code is

How to change the collapse/expand icon to right side of TreeView of material?

陌路散爱 提交于 2020-02-06 08:09:40
问题 I am trying to implement a tree using the material in Reactjs. But, according to my design, the button to collapse and expand should be on the right side. Also, I am getting an error when added an icon in TreeItem like this: <TreeItem nodeId="1" label="RSMSSB" icon={FolderIcon}> Whole code: import React from "react"; import { makeStyles } from "@material-ui/core/styles"; import TreeView from "@material-ui/lab/TreeView"; import ExpandMoreIcon from "@material-ui/icons/ExpandMore"; import