material-ui

How can I create a clickable first option in Material UI Labs Autocomplete

空扰寡人 提交于 2020-01-21 18:52:29
问题 Below you can find an example from the MUI docs on Autocomplete where I've passed a link to google, prior to the options list. However, I can't click that option, the event target is just the MuiAutocomplete, rather than the <a> I'm passing. import React from "react"; import TextField from "@material-ui/core/TextField"; import Paper from "@material-ui/core/Paper"; import Autocomplete from "@material-ui/lab/Autocomplete"; const Link = ({ children }) => ( <Paper> <a href="https://www.google.com

DefinitelyTyped: Add new props typing for existing component

旧巷老猫 提交于 2020-01-17 06:54:14
问题 Is there any way to declare new typing for new props within DefinitelyTyped ? I updated material-ui with some new props in SelectField component, but typings in DefinitelyTyped are old. Can I extend in some way SelectField typing and add new props types? Now I have: <SelectField multiple={true} hintText="Select type" value={[...this.state.values]} onChange={this.onChange} selectionRenderer={this.selectionRenderer} > And I need to add multiple?: boolean and selectionRenderer: (values: any[]) =

DefinitelyTyped: Add new props typing for existing component

元气小坏坏 提交于 2020-01-17 06:54:13
问题 Is there any way to declare new typing for new props within DefinitelyTyped ? I updated material-ui with some new props in SelectField component, but typings in DefinitelyTyped are old. Can I extend in some way SelectField typing and add new props types? Now I have: <SelectField multiple={true} hintText="Select type" value={[...this.state.values]} onChange={this.onChange} selectionRenderer={this.selectionRenderer} > And I need to add multiple?: boolean and selectionRenderer: (values: any[]) =

How to modify font-size/style of Tooltip component?

主宰稳场 提交于 2020-01-16 19:37:07
问题 Not able to assign custom class to tooltip component in order to update the style of tooltip component Tried by assigning to classes property Posted at https://codesandbox.io/s/twilight-fire-907mp 回答1: Make your own Tooltip with custom styles and then use it: const TooltipWithBiggerFontSize = withStyles({ tooltip: { fontSize: 30 } })(Tooltip) As you already did with other components, eg: DialogContent or DialogActions . Usage <TooltipWithBiggerFontSize title="Custom Search"> <Publish /> <

How to modify font-size/style of Tooltip component?

浪尽此生 提交于 2020-01-16 19:35:06
问题 Not able to assign custom class to tooltip component in order to update the style of tooltip component Tried by assigning to classes property Posted at https://codesandbox.io/s/twilight-fire-907mp 回答1: Make your own Tooltip with custom styles and then use it: const TooltipWithBiggerFontSize = withStyles({ tooltip: { fontSize: 30 } })(Tooltip) As you already did with other components, eg: DialogContent or DialogActions . Usage <TooltipWithBiggerFontSize title="Custom Search"> <Publish /> <

Font size of tooltip in speeddialaction of React's Material UI

依然范特西╮ 提交于 2020-01-16 09:06:11
问题 How to modify font size of tooltip shown on hovering over speeddialaction component? Link to SpeedDial Component https://material-ui.com/components/speed-dial/ Link to Speeddialaction component https://material-ui.com/api/speed-dial-action/ 回答1: You can style tooltip by adding TooltipClasses prop to SpeedDialAction component. All that classes will be passed to Tooltip component, as it is written in SpeedDialAction docs Here is modified example from official docs: import React, { useState }

overwrite the font size of this class .MuiTypography-body1

a 夏天 提交于 2020-01-16 09:01:06
问题 I tried to overwrite the font size of this class .MuiTypography-body1 so I researched and found this link https://material-ui.com/api/typography/ but the problem is its not overwriting can you tell me how to fix it. providing my code snippet below and sandbox below https://codesandbox.io/s/material-demo-yr83v const useStyles = makeStyles(theme => ({ root: { fontSize: "2" }, checkboxLabel: { border: "1px solid black", fontWeight: "100", fontSize: "20" }, body1Text: { fontSize: "2" } })); <div

How to change the value of input dynamically?

江枫思渺然 提交于 2020-01-15 11:45:29
问题 I have a dynamic inputs, which I can add and delete a row with inputs, there are inputs of material-ui for timepicker, which having an input with her icon of a clock when I click on it the clock will appear. but the values of this input cannot change with the clock. My code is : import { TimePicker } from "material-ui-time-picker"; import { Input as Time, Dialog as Clock, DialogActions, Button as ButtonOk } from "@material-ui/core"; constructor(props) { super(props); this.state = { isOpenS:

React Material-UI pure javascript

做~自己de王妃 提交于 2020-01-15 10:28:21
问题 I'm trying to make Material-UI work in pure javascript (no babel, modules, jsx or such things) <!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title>Bridge Bridge.React.Examples</title> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"> <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> <script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"><

Material-UI : How to properly set userAgent for server-side rendering

血红的双手。 提交于 2020-01-15 09:24:27
问题 I'm getting this warning : Material-UI: userAgent should be supplied in the muiTheme context for server-side rendering with the following server side rendering setup, what am I doing wrong : match({routes: R(), location}, (error, redirectLocation, renderProps) => { if (error) { console.error("error: "+ error) } else if (redirectLocation) { console.error("redirect to " + redirectLocation) } else if (renderProps) { const theme = getMuiTheme({userAgent: "all"}) page = ReactDOMServer