material-ui

How do I custom style the underline of Material-UI without using theme?

允我心安 提交于 2019-12-17 06:56:13
问题 I have success with outline custom styling when variant="outlined" and I use notchedOutline in InputProps . Otherwise - variant=[anything else] where only a bottom border exists - it doesn't work, even with underline as the key/class in InputProps . I've even tried root . export default ({ boxType, classes, value, onChange, style }) => ( <TextField variant={boxType || "standard"} value={value} onChange={onChange} InputProps={{ classes: { notchedOutline: classes.notchedOutline, underline:

redux form Element type is invalid: expected a string (for built-in components)

瘦欲@ 提交于 2019-12-14 03:29:25
问题 In my stepper code Iam trying to include the radio button. When I include the radio button I am getting the below error. I looked into this example https://redux-form.com/6.0.0-alpha.6/examples/simple/ and then imeplemented but still I am faccing errors. Can you tell me how to fix it, so that in future I will fix it myself. Providing my sandbox and code snippet below. https://codesandbox.io/s/0prxxxvy0n Element type is invalid: expected a string (for built-in components) or a class/function

How to make a circle checkbox with Material UI?

徘徊边缘 提交于 2019-12-14 01:48:56
问题 The design I have been given to try to match requires a checkbox to be a circle. I'm using Material UI with React. Border radius does not work because the border of the actual icon is not the border of the visible checkbox. I can't just use something like Font Awesome, because it needs to actually be checked and unchecked. // Current Styling const styles = theme => ({ nested: { paddingLeft: theme.spacing.unit * 4, }, icon: { margin: theme.spacing.unit, fontSize: 25, }, root: { color: cyan[

Material-ui: open menu by event hover

青春壹個敷衍的年華 提交于 2019-12-14 00:55:24
问题 Currently the menuItem only opens your children after a click. Is there an attribute that I agree to open via Hover? <MenuItem key={index} menuItems={menuitems} **onHover={true}** > menuItem </MenuItem> 回答1: There is not specific attribute available through the material-ui library. However, you could create this yourself pretty easily using the onMouseOver event. I've adapted the Simple Menu example from the material-ui site to show you how this can be done: import React from 'react'; import

React JS: Apply Material-UI CssBaseline

你说的曾经没有我的故事 提交于 2019-12-14 00:23:42
问题 I want to give my new React app a consistent look and feel using Material-UI . Also, I want the styles and such to be easily maintainable. So the default theme seems like a pretty good start. The cssBaseline offered by Material-UI seems to check all the boxes, so I want to give it a try. The thing is, surprise, it's not working. Css themes aren't really my thing. Am I misguided here or what? The following code is what I've implemented in my App.js component with no luck (taken from here ). I

How to make a Material UI react Button act as a react-router-dom Link?

让人想犯罪 __ 提交于 2019-12-14 00:20:23
问题 How can I make a Material UI react Button component act as a Link component from react-router-dom without losing it's original style? Like changing the route on click. import Button from '@material-ui/core/Button'; <Button variant="contained" color="primary"> About Page </Button> To something like this, but maintaining the original Button style: import Button from '@material-ui/core/Button'; import { Link } from 'react-router-dom'; <Button variant="contained" color="primary"> <Link to="/about

React material table automatic page size

那年仲夏 提交于 2019-12-13 19:48:24
问题 I am using React + Material Table. Questions I have Is there a way to dynamically set pageSize based on the available space on the page? If there is no API to do so - how to better approach this problem from component design perspective? What am I trying to achieve? The number of rows displayed in a Material Table should depend on screen size. The page will not look similar depending on your screen size (e.g. on laptop device it could look fine, but on 25 inch display there will be a lot of

how do I run material-ui locally

别来无恙 提交于 2019-12-13 17:26:07
问题 I'm trying to run the material-ui docs locally. I downloaded the material-ui repository https://github.com/mui-org/material-ui/ Did the npm install Now when I try to run it I get the following error ERROR Failed to compile with 5 errors 11:06:22 These dependencies were not found: react-jss/lib/contextTypes in ./packages/material-ui/src/styles/withStyles.js react-jss/lib/ns in ./packages/material-ui/src/styles/withStyles.js recompose/getDisplayName in ./packages/material-ui/src/styles

Why doesn't <Table/> show the check box when rendered multiple times?

亡梦爱人 提交于 2019-12-13 17:21:22
问题 I am using <Table/> from http://www.material-ui.com/#/components/table . When I render the <TableRowColumn/> multiple times depending on how many objects are in the array, the checkboxes do not appear. For example, if there are two objects, it renders two rows, but the checkboxes don't show. What may be the issue? COMPLETELY NEW EDIT So the FileTable.js is rendered on another page, and it is triggered to be made by a button inside an index route Home.js . render( <div> <Provider store={store}

React code locking in endless loop - no while loops involved

↘锁芯ラ 提交于 2019-12-13 14:50:33
问题 Am a bit new to React and wrote this code below. The component below is for rendering a Time and Date Picker for a tale. The time and date pickers only render for those social media where the tale is scheduled to appear. class TaleScheduler extends Component { constructor(props) { super(props); this.state = { returnData: {}, totalNeeded: numberOfChannels(this.props.data) }; } setSchedule = (date, channel) => { const returnData = update(this.state.returnData, { $merge: {channel: date} }) this