material-ui

React material-ui: centering items on Toolbar

别来无恙 提交于 2019-12-04 18:33:56
I am trying to implement a toolbar on a page in which I have three ToolbarGroup components: <Toolbar> <ToolbarGroup firstChild={true} float="left"> {prevButton} </ToolbarGroup> <ToolbarGroup> {releaseBtn} </ToolbarGroup> <ToolbarGroup lastChild={true} float="right"> {nextButton} </ToolbarGroup> </Toolbar> The general idea is that prevButton should render all the way to the left of the toolbar (it does), nextButton should render all the way to the right (it does)... and that releaseBtn should be centered on the toolbar (not currently happening). Per the material-ui docs there doesn't appear to

How to use custom Input with Formik in React?

╄→尐↘猪︶ㄣ 提交于 2019-12-04 16:13:08
问题 I'm trying to use DatePicker within Formik. But when I click DatePicker's date its form value is not changed. Instead, I got this error: Uncaught TypeError: e.persist is not a function at Formik._this.handleChange (formik.es6.js:5960) I shortify code, the code is below const SomeComponent = () => ( <Formik render={({ values, handleSubmit, handleChange, setFieldValue }) => { return ( <div> <form onSubmit={handleSubmit}> <DatePicker name={'joinedAt'} value={values['joinedAt']} onChange=

ReactJS align material-ui elements horizontally

馋奶兔 提交于 2019-12-04 11:10:44
I am trying to have a radio button next to a text input so essentially a user can input "answers" to a question and mark one preferred. However, Material-UI puts each on it's own line. This is what I currently have : <div> <RadioButton value="light" /> <TextInput hintText="Answer" multiLine = {true} /> </div> Just for the record, I managed to align radio buttons using flexboxgrid ... Did something like this: <div className="row"> <div className="col-md-2"> Type: </div> <div className="col-md-10"> <RadioButtonGroup className="row" name="type"> <RadioButton className="col-md-4" value="other"

How to make AppBar component from material-ui-next react to scroll events

孤街浪徒 提交于 2019-12-04 08:16:34
As per Material Design guidelines : Upon scrolling, the top app bar can […] transform in the following ways: - Scrolling upward hides the top app bar - Scrolling downward reveals the top app bar When the top app bar scrolls, its elevation above other elements becomes apparent. Is there any built-in approach to do this in material-ui-next or should it be considered as a new feature? Can you give a hint on how to achieve the animation of the AppBar component as described in the guidelines? To my knowledge, there's no out-of-the-box solution for this at the moment. It's quite easy to implement

How to use material-ui framework? [closed]

给你一囗甜甜゛ 提交于 2019-12-04 07:46:15
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I'm planning to use Material-UI CSS framework (http://material-ui.com) in order to design front-end of a website, but I don't have any idea about how to use this framework. I'm not familiar a lot with NPM, Browserify, etc. I just need to know how shall I start in order to learn

Getting started with material-ui

走远了吗. 提交于 2019-12-04 07:32:50
Seems to me the well-kept secret is the material-ui, a web framework that uses Google's Material Design UI , plus React. I think it is a fantastic combination, and the future. However, it is also a well well-kept secret on how to use it. The Getting started guide at http://material-ui.com/#/get-started is not for normal Joe, but only for a tiny fraction of people that might understand it. Moreover, the questions here, like How to use material-ui framework? , material ui Installation configure , have never been answered. I managed to get material-ui installed, $ npm install material-ui react

React JS: Apply Material-UI CssBaseline

僤鯓⒐⒋嵵緔 提交于 2019-12-04 05:53:10
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'm hoping is just an implmentation detail. import React from "react"; import Footer from "./Footer";

Warning: Unreachable code , using Reactjs

橙三吉。 提交于 2019-12-04 05:10:41
问题 I am using ReactJs. I have two Components,PrescriptionIndex and PrescriptionNew, integrating one with another. This is my first component 'PrescriptionNew' import React, { Component } from 'react'; import FloatingActionButton from 'material-ui/FloatingActionButton'; import ContentAdd from 'material-ui/svg-icons/content/add'; import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider' class PrescriptionNew extends Component { render(){ return( <div> <MuiThemeProvider>

How to use custom Input with Formik in React?

坚强是说给别人听的谎言 提交于 2019-12-04 00:50:09
I'm trying to use DatePicker within Formik . But when I click DatePicker's date its form value is not changed. Instead, I got this error: Uncaught TypeError: e.persist is not a function at Formik._this.handleChange (formik.es6.js:5960) I shortify code, the code is below const SomeComponent = () => ( <Formik render={({ values, handleSubmit, handleChange, setFieldValue }) => { return ( <div> <form onSubmit={handleSubmit}> <DatePicker name={'joinedAt'} value={values['joinedAt']} onChange={handleChange} /> </form> </div> ) }} /> ) I googled few documents, https://github.com/jaredpalmer/formik

Dispatch a Redux action with the subsequent action as payload to show a snackbar or dialog of Material UI

我怕爱的太早我们不能终老 提交于 2019-12-04 00:28:24
I'm using React with Redux and Material UI to build a webapp. The webapp is made of several pages and components. I know that a snackbar or dialog should be directly connected to what the user is doing. However, I'd like to make the snackbar and dialog independent on the pages and components. A use case therefore is displaying a message like background synchronization of your data failed and an action retry now . My idea was to render the snackbar on a page called RootFrame , which is used to wrap all other pages and to dispatch the text of the snackbar as payload of an action. My Redux action