material-ui

Flutter FilterChip Avatar Selected Style

烈酒焚心 提交于 2019-12-08 22:19:32
问题 I'm using FilterChip with a CircleAvatar for avatar, but the selected state has a nasty rectangle that I can't seem to find any reference for. How do I remove it? Code: child: FilterChip( avatar: CircleAvatar( backgroundColor: category.color ), label: Text(category.name), selected: badCategoryIds.contains(category.id), onSelected: (bool value) { if (value) { badCategoryIds.add(category.id); } else { badCategoryIds.remove(category.id); } categoryChoiceCallback(badCategoryIds); }, ) Result: How

In Material UI, How can I override a selector selected component style?

半世苍凉 提交于 2019-12-08 19:21:22
In Material UI, to extend the distance between MuiInputLabel and MuiInput , I have to override the marginTop of label + .MuiInput-formControl . However, createMuiTheme 's override only provide direct override of a Mui Component CSS, such as: createMuiTheme({ overrides: { MuiInput: { formControl: { marginTop: '1.5rem', }, }, } }) How can I do something like: createMuiTheme({ overrides: { 'label+MuiInput': { formControl: { marginTop: '1.5rem', }, }, } }) Thanks... Here's the relevant JSS documentation: https://cssinjs.org/jss-plugin-nested?v=v10.0.0-alpha.10#use--to-reference-selector-of-the

changing font size of material-ui buttons, and having the buttons scale?

旧时模样 提交于 2019-12-08 17:22:54
问题 I seem to be having an issue with changing the font sizes on Material-UI's (for React) RaisedButton and having the button itself scale properly with it. <RaisedButton label={<span className="buttonText">Log in Here</span>} /> CSS: .buttonText { font-size: 63px; } The text size changes but the button itself doesn't scale with it. Does anyone know the proper solution to this? I want to button to scale with the text size. 回答1: The problem is Material-UI inlines all of the styles for their

How to over-ride an @media css for a material-ui react component

半世苍凉 提交于 2019-12-08 17:09:51
问题 In this question I asked how to override a css property of a material-ui component and was provided a nice example. However, when trying to set the height of the Toolbar component I found I could not override the css due to an over arching @media specification. The following MuiTheme spec was my approach: const theme = createMuiTheme({ overrides: { MuiToolbar: { regular: { height: "32px", minHeight: "32px" } }, } }); Here is a visual of the css being over-ridden: If I introduce a hack and add

How to focus a Material UI Textfield on button click?

走远了吗. 提交于 2019-12-08 17:07:47
问题 How to focus a Textfield after clicking a button. I tried to use autoFocus but it did not work out: Example sandbox <div> <button onclick={() => this.setState({ focus: true })}> Click to focus Textfield </button> <br /> <TextField label="My Textfield" id="mui-theme-provider-input" autoFocus={this.state.focus} /> </div> 回答1: You need to use a ref, see https://reactjs.org/docs/refs-and-the-dom.html#adding-a-ref-to-a-dom-element class CustomTextInput extends React.Component { constructor(props)

not able to auto import react components from node modules

我们两清 提交于 2019-12-08 16:43:35
I have recently started working with vs code. I am using material ui with react and type script. But I am not able to import the components of material ui using alt(option) + enter shortcut. I am using mac and the typescript version that I am using is 3.0.3. However, the react components that I am creating explicitly, those I am able to import using the above mentioned shortcut. Following is the package.json that I am using: { "name": "portfolio", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "build": "webpack" }, "author": "ahujru", "license": "ISC", "dependencies":

Accessing previous theme variables in createMuiTheme

谁说我不能喝 提交于 2019-12-08 16:12:06
问题 Running Material UI 1.0.0-beta.24 I'm setting a new theme using createMuiTheme : import {createMuiTheme} from 'material-ui/styles'; const theme = createMuiTheme({ typography: { fontSize: 16 } }); export default theme; How can I access the theme I'm overriding directly here ? I'd like to do this, which is not working : import {createMuiTheme} from 'material-ui/styles'; const theme = createMuiTheme({ typography: { fontSize: theme.typography.fontSize + 2 } }); export default theme; 回答1: You'd

Material-ui - TableRow wrapped in component wont show checkbox

偶尔善良 提交于 2019-12-08 15:59:12
问题 I'm using Material-ui in my project and I'm facing an issue. I would like to use Table component to show a dynamic list of items with checkbox on each row. This is what my render looks like : <Table multiSelectable={true}> <TableHeader> <TableRow> <TableHeaderColumn>Reference</TableHeaderColumn> .... All others columns ... <TableHeaderColumn>Actions</TableHeaderColumn> </TableRow> </TableHeader> <TableBody displayRowCheckbox={ true }> { this.generateOrderRows() } </TableBody> </Table> The

Difference between Material-Ui and Material-Ui-Next

﹥>﹥吖頭↗ 提交于 2019-12-08 15:26:35
问题 I am trying to add Material-Ui React components in my project and I'm confused with these 2 websites / libraries. Material-Ui-Next -> https://material-ui-next.com/ Material-Ui -> http://www.material-ui.com Both websites have a link to Github - https://github.com/mui-org/material-ui Are they same or different? Both of them are using import {something} from 'material-ui/xxx' to import the components. I'm confused and which one I should learn/use in my project. Can you suggest? 回答1: Material-UI

Module '…' resolves to a non-module entity and cannot be imported using this construct

喜你入骨 提交于 2019-12-08 15:12:15
问题 I have a .tsx file in which I am trying to import a RaisedButton component from material-ui like so: import * as RaisedButton from 'material-ui/lib/raised-button' However, that gives me the error described in the title, any ideas what I might be doing wrong? 回答1: This is from the material-ui.d.ts file. export import RaisedButton = __MaterialUI.RaisedButton; // require('material-ui/lib/raised-button'); So you should import it like this. import RaisedButton = require('material-ui/lib/raised