Questions tagged [material-ui]

This particular tag is intended for inquiries related to the Material UI library. It encompasses React components designed to adhere to Google's renowned Material Design principles. The diligent maintenance of this open-source venture is undertaken by MUI.

How to set a background image in next.js with the help of MUI

English is not my first language, so please bear with me. I am currently working on a search engine home page in next.js 14 and I have encountered an issue. I want to incorporate a background image with a dark filter under the search bar. However, my curr ...

Exploring the contrast between materialize-css and material UI libraries

After exploring the home pages of materializecss and materialUI, I noticed that materializecss describes itself as a modern responsive front-end framework based on Material Design, while materialUI mentions React components that implement Google's Mat ...

React Redux Loading progress bar for seamless navigation within React Router

Currently, I am working on adding a loading bar similar to the one used by Github. My goal is to have it start loading when a user clicks on another page and finish once the page has fully loaded. In order to achieve this, I am utilizing material-ui and t ...

What could be causing the unpredictable behavior of my Material UI Tabs component, where it seems to be overriding other

I am facing an issue with the styling of tabs in my React app dashboard that uses Material UI Tabs. Specifically, I have a tab in the dashboard that opens a modal for adding new users to the system. The modal itself also contains tabs, but no matter how I ...

Can you please guide me on submitting an example of signing in using Material UI?

I have successfully implemented a SignIn component by following the example provided in Material UI's documentation, which can be found here. import React from 'react'; import PropTypes from 'prop-types'; import Avatar from ' ...

Creating a background with image overlays in React: A step-by-step guide

My challenge is to have an image that covers the entire background but it seems to stop abruptly where another object is placed, unable to extend further. I am utilizing Material UI and here is a snippet of my code: import { Image } from "../images&q ...

A tutorial on how to customize the hover effect for TableHead Column Identifiers in MaterialUI by adjusting

I'm struggling to customize the appearance of child th elements using the TableHead component from MaterialUI. While I've been successful in modifying various properties, I'm facing difficulty in changing the hover color. Below is the snipp ...

Managing State changes efficiently in React using a single handleChange method for handling selectFields and TextFields

Seeking guidance on how to manage state changes using a single handleChange method. I am currently handling two text fields with handleChange, but I am struggling to incorporate changes from the SelectField component into the same handleChange method. Fo ...

Having difficulty coming back from a promise catch block

I'm struggling to populate a menu list from my PouchDB database because I am unable to retrieve anything within the promise that is executed after calling get on the db. Below is the code in question: <MenuList> {this.populateSavedClues()} </ ...

Ensuring Tab Input Validation in ReactJs with the Help of Form Validator

After browsing through some Q&A, I stumbled upon a thread on the topic of Tabbed form and validation. Although it was close to addressing my issue, it did not provide a solution. I am currently utilizing react-material-ui-form-validator. When multiple ...

What is the process of deselecting a RadioButton?

Imagine I have a group of RadioButtons. After clicking one, I realize that I don't want to submit the form after all. Instead, I just want to cancel and return to the state where none are selected. How can I achieve this? ...

Ways to conceal a specific option within a select tag in MUI React

When dealing with a select tag, the default behavior is that the Click option is disabled and hidden. However, if you want to show an option by default and make sure it remains invisible when the user clicks on the select tag, it can be a bit tricky. Set ...

Display cabinet design

I searched the documentation thoroughly but could not locate an attribute called z-index that specifies how the Drawer should be displayed in relation to the AppBar - should it appear over or beneath it? Are there any efficient methods to achieve this? T ...

The process for incorporating two distinct Google fonts into a Next.js project using Material UI

Currently in the process of upgrading my MUI5 application from Next 12 to Next 13 and experimenting with integrating next/font. In my previous Next 12 version, I utilized two Google fonts - 'Rubik' and 'Ephesis' which were included in t ...

Customize the default classes for DataGrid in Material UI

Attempting to customize the CSS properties in the "DataGrid" Material UI, specifically adjusting font weight and overflow of the header. Below is the JSX code snippet: import React, {useState, useEffect} from 'react'; import {DataGrid, GridToolbarContaine ...

The use of Google Material Symbols is incompatible with lazy loaded components in a Vue.js application

How can I implement material symbols in a lazy loaded or dynamically imported Vue.js component? My current configuration is not working as the icons only show up in statically loaded views: Main.js import { createApp } from 'vue/dist/vue.esm-bundler'; imp ...

Can you explain the significance of the ColSpan property in the Material UI TablePagination?

Why is ColSpan used in this code snippet? Reference: https://material-ui.com/components/tables/#table Check for the arrow symbol <TableFooter> <TableRow> <TablePagination rowsPerPageOptions={[5, ...

Issue with integrating Material-UI's Menu Item and Select components in redux-form Field (redux form 8.2)

My goal is to create a dropdown select using Material-UI within a redux-form. I found an example for incorporating M-UI's selects into a redux form on their website. I want to replicate the same example but using Material UI's MenuItems instead ...

Explore a personalized color scheme within MUI themes to enhance your design

I'm looking to customize the colors in my theme for specific categories within my application. I set up a theme and am utilizing it in my component like this: theme.tsx import { createTheme, Theme } from '@mui/material/styles' import { red } from '@mui/m ...

Issue with Material UI select component not displaying the label text

I've been struggling with Material UI's "Select" for quite some time now - spent about 10 hours trying to make it work the way I want. Any help would be greatly appreciated. This question is connected to a previous one: Select MenuItem doesn' ...

React Hooks: Issue with UseRef not detecting events from Material UI Select component

I'm currently utilizing React Hooks in my project. I am attempting to trigger an onclick event using the useRef hook. const component1: React.FC<Props> = props { const node =useRef<HTMLDivElement>(null); const ClickListe ...

Set the Checkbox selections by utilizing the array values in the MUI DataGrid

In my MUI Datagrid, I have 2 columns for ID and City Name. There are only 3 cities represented in the table. Within a citizen object like this: const userMockup = { id: 1, name: "Citizen 1", cities: [1, 2], isAlive: true }; The cities ar ...

The Material-ui paper component fails to display on the screen

The material-ui paper component is implemented on my homepage and functioning correctly. However, when navigating to another page and returning to the homepage, the paper component disappears, leaving only text rendered. Can you help me identify the issue? ...

What is the best way to include the "onChange" function in a component that does not natively support this prop?

After finding a useful code snippet on this page to switch languages, I attempted to enhance it by incorporating material UI components for better styling. However, whenever I change the language, it redirects me back to the home page because the MenuList ...

What are the different ways to customize the indicator color of React Material UI Tabs using hex

Just got my hands on this amazing Material UI component <Tabs textColor="primary" indicatorColor="primary" > <Tab label="All Issues"/> </Tabs> The documentation states that indicatorColor and textColor can only be set to 'prima ...

The search for 'Autocomplete' in version ^4.11.2 within '@material-ui/core' did not yield any results

After clicking on the lab version link provided for Autocomplete at this repository, I expected to find it in the core with version 4.11.2. However, it seems that it is still not accessible. ...

Guide to programmatically include and exclude a series of switch buttons using Material-UI in ReactJS

Having a bit of trouble with this situation - I want to allow users to select multiple days as a condition using toggleButtons from material-ui. I also want to include a plus button so they can add or remove sets of days. Any suggestions on how I can mak ...

Does the onChange event fire when the value is modified by the parent element?

let [number, set_number] = useState({x: 1}); <ChildComponent number={number} onUpdate={onUpdateFunction} </ChildComponent> set_number({x: 2}) After running set_number({x: 2}), will this action prompt the execution of onUpdateFunction refere ...

Unexpected behavior observed with Form Input value property

Hey there! I'm currently working on setting up a form to gather input for creating an event listing. I've been referencing the React documentation on how to use the 'value' property: https://reactjs.org/docs/forms.html ,to capture use ...

Issue with AppBar not adhering to defined theme color in material-ui

I have utilized a theme created from the following site: My requirement is to have the primary color as RED and the secondary color as BLUE. Additionally, I would like the AppBar to have a shade of grey. The preview showcases the AppBar in the desired col ...

Warning: The findDOMNode function in StrictMode is deprecated for material-ui Drawer component

My ReactJS app is built using hooks and StrictMode, with React version 16.13.1 and Material-UI version 4.9.10. The Appbar in my app utilizes Drawer: <div className={classes.root}> <AppBar position="static"> <Toolba ...

What is the best way to retrieve the ID of the cell that is currently being focused on in the MUI Data Grid?

With the MUI Data Grid, users have the ability to click on a cell to bring it into focus, navigate through cells using keyboard arrows, and manually set the focused cell. One thing that I'm struggling with is determining which cell is currently in fo ...

Assigning a data-cy value to the mui textInput helper is essential for targeting

My goal is to assign the cypress data-cy attribute as a helper text for a Material-UI TextField. I successfully adjusted the style of this helper text by providing a custom style property to FormHelperTextProps: FormHelperTextProps={{ sty ...

Styling Material-UI's AutoComplete Component

I've experimented with various CSS variations, but I'm unable to change the "focus" state of the outline-color/border-color for the Autocomplete Component. I've spent hours trying to figure out how to change the color to green instead of the current blue. ...

How can you limit the height of an image to match the height of an AppBar in Material-UI?

Looking for advice on how to properly place an image in an AppBar within the standard material height restrictions, like 64px for desktop? Currently utilizing material-ui@next (1.0.0-beta.2). This code snippet seems to work well: <AppBar> <To ...

Issue with Material-UI: flip:false not functioning properly

Just starting out with Material-UI and jss, attempting to incorporate them into a project that uses right-to-left writing direction. Following the documentation, I managed to set it up and have all MUI components automatically adjust for RTL. However, the ...

The input field in Ckeditor dialogs becomes inaccessible when the editor is placed within a modal interface

Currently, I am incorporating material-ui-next dialog with CKEditor as the editor placed within the modal. In order to add LaTeX text, I have utilized the MathJax plugin. However, I have encountered an issue where I am unable to focus the input field to pr ...

necessity for a condition in Material UI input field

I need assistance with a function that I use to incorporate Material UI text fields into my code. The issue I'm currently facing is figuring out how to dynamically add the "required" attribute based on a boolean parameter that determines whether the f ...

Issue with card grid layout not displaying correct spacing. See sandbox for example

(adjust the output to trigger the md breakpoint and display cards in a row) Check out this link for reference. I'm attempting to add space between each card, but it doesn't seem to be working as expected. ...

Ways to deactivate a Material-UI submit button linked with Formik

Formik integration with Mui for a button component: import React from "react"; import { Button } from "@mui/material"; import { useFormikContext } from "formik"; const ButtonWrapper = ({ children, ...otherProps }) => { ...

Designing an interactive header interface using React and Material UI

My header.jsx file contains the following code: // Default Import Statements var Login = require(login.jsx) const HeaderComponent = React.createClass({ getInitialState () { return { loggedIn: false, }; }, render() { return ( ...

Unable to view image when using material-ui CardMedia component

Hello, I've encountered a problem with rendering an image in my application. Let me explain the issue in a simplified manner. So, I have a card component (MyCardComponent) where I need to pass a string prop containing the image file location. The goal is ...

What is the best way to turn off the automatic capitalization of text in a Button component using Material UI v5

Is there a way to disable the automatic uppercase feature on the <Button> component in material UI 5? <Button variant="contained">Hello</Button> By default, the text will be displayed as HELLO, but I prefer it to remain as Hell ...

MUI full screen dialog with material-table

Issue: When I click a button on my material-table, it opens a full-screen dialog. However, after closing the dialog, I am unable to interact with any other elements on the screen. The dialog's wrapper container seems to be blocking the entire screen. This ...

Creating Beautiful Tabs with React Material-UI's Styling Features

I've been delving into React for a few hours now, but I'm struggling to achieve the desired outcome. My goal is to make the underline color of the Tabs white: https://i.stack.imgur.com/7m5nq.jpg And also eliminate the onClick ripple effect: https://i.st ...

Tips for hiding the frame of a React MUI Select component

I am having trouble figuring out how to remove the border around the <Select> component from the React Material UI library. In the image below, you can see that when the <Select> component is not selected, it has a black border/frame. https:// ...

Is it possible to include the component name in the class names used with `styled` in MUI v5

I've been looking through GitHub and other resources, but I feel like I might be approaching this the wrong way. When using styled from @mui/material/styles, it creates random class names like this: https://i.stack.imgur.com/pdARg.png const TitleWra ...

Customizing SVG icon colors in ToggleButton upon selection

My project includes 4 ButtonGroups from MUI, each with an SVG Icon and a button name as children. The background color of the button and the name change when selected, but the SVG icon remains the same color at all times. How can I make it so that the SVG ...

Is there a way to smoothly transition to the starting index of a LazyColumn when utilizing SnapFlingBehavior in Jetpack Compose?

Hey there, I've got a fascinating question to discuss about snapping in Compose development. With the introduction of snapping as a 1st class API for LazyColumn, replacing the Snapper library, a new query has emerged. How can one initialize the LazyCo ...

Incorporating a component with material-table alters the style of the Material-UI AppBar

Utilizing Material-UI along with material-table for my app. I have implemented a global theme in the "index.js" file using "ThemeProvider" and included the following components: <Fragment> <CssBaseline /> <MenuAppBar /> < ...

A guide on integrating the Next.js Link component within a Material UI Menu

I am currently using a Material UI menu like this: <Menu id="simple-menu" anchorEl={anchorEl} keepMounted open={!!anchorEl} onClose={handleClose}> <MenuItem onClick={handleClose}>Profile</MenuItem> <MenuItem onClick={ ...

Switch Focus and Collapse Submenus upon Menu Click in Recursive React Menu

I've created a dynamic menu system in React using Material-UI that supports recursion for submenus. I'm aiming to implement the following features: 1. When a menu item is clicked, all other open submenus should close and focus on the clicked men ...

"Adjusting the position of the Icon in the Material UI ItemList to make it closer

How can I bring this icon closer to the text? I'm not sure how to do it. When I enter developer mode, it shows me this. https://i.stack.imgur.com/WzhB1.png I am uncertain about what the purplish stuff indicates. My objective is to move the icon to the up ...

Enhance your material-ui component using TypeScript functionality

Exploring ways to enhance the Material-ui Button component by introducing new props. The objective is to introduce a new prop called fontSize with three size options - small, medium, large. <Button variant="outlined" color="primary" ...

Floating Action Button is not properly attached to its parent container

When developing my React Js app, I decided to utilize the impressive libraries of Material UI v4. One particular component I customized is a Floating Action Button (FAB). The FAB component, illustrated as the red box in the image below, needs to remain p ...

Update a specific ListItem in a List when the key is already present (ReactJS with MaterialUI)

Just a heads up, I'm working with material-ui using ReactJS and following the Redux pattern. Issue: I have an array that is being displayed in a List component with individual ListItems. However, when the array gets updated, the props change triggering t ...

The Tooltip from React's material-ui@next component fails to render adjacent to the element within the TableHead Cell

In my React project using versions 15.6.2 and 16, along with material-ui@next version 1.0.0-beta.12, I encountered an issue with the Tooltip component. When I use the <Tooltip> inside a table header, the tooltip displays in the top left corner of the ...

Utilizing pseudo-selectors in customizing styleOverrides within MUI version 5 Theming

The documentation for MUI(v5) includes an example highlighting the use of global style overrides: const theme = createTheme({ components: { MuiButton: { styleOverrides: { root: { // How to use pseudo-class here? // I ...

Encountering an issue with extending the MUI color palette, receiving a "reading 'dark'" error due to properties of undefined

Encountering an issue when trying to expand the MUI color palette—getting this error instead: Error: Cannot read properties of undefined (reading 'dark') Take a look at my theme.ts file below: const theme = createTheme({ palette: { pri ...

A step-by-step guide on incorporating MarkerClusterer into a google-map-react component

I am looking to integrate MarkerClusterer into my Google Map using a library or component. Here is a snippet of my current code. Can anyone provide guidance on how I can achieve this with the google-map-react library? Thank you. const handleApiLoaded = ({ ...

Difficulty changing paper background color with Material UI ThemeProvider

I'm currently working on a React frontend project using Material UI. I've created a basic Paper component and I'm trying to change its background color to match the primary color set in ThemeProvider. Here's the snippet of my code: import React from 'react ...

Is it possible to change the position of the checkbox label to be above the checkbox instead

I was looking through the official documentation and saw that the Checkbox component has a prop called labelPosition which can be set to either right or left. However, I am trying to figure out if it's possible to position the label above the checkbox ...

What could be the reason for the checkbox not being selected in a React component

I'm currently working on integrating an autocomplete feature with checkboxes. Learn more here https://i.stack.imgur.com/YtxSS.png However, when trying to use the same component in final-form, I'm facing issues with checking my options. Why is that? Belo ...

What is the correct way to position a material-ui icon within a button for proper alignment?

Is there a way to properly align the <ChevronRightIcon> within the <PrimaryButton>? I want it to appear after the button label on the right side. https://i.stack.imgur.com/dcEWo.png <PrimaryButton style={{ paddingRight: &apo ...

The validation of DOM nesting has detected that a <td> element cannot be placed within an <a> element

When working on a React project with Material UI, I encountered an issue while trying to create a table. My goal was to make the entire row clickable, directing users to a page with additional information on the subject. Below is the snippet of code for th ...

What is the best approach for generating individual variables for every row in a React table?

Presently, I am developing a dynamic table using react and the structure is as follows: <TableBody> {finalLoadedTokensData.map((loadedToken, index) => { const isItemSelected = isSelected(loadedToken.contract); const label ...

How can we show a varying number of textfields based on user selection using hooks and updating values dynamically through onChange events?

Currently, I am in the process of setting up a form that includes a Material UI select field ranging from 1 to 50. My challenge is how to dynamically display multiple textfields for "First Name and Last Name" using Hooks each time the user selects a number ...

Achieving Harmony in Design: Striking a Balance Between the Heights of Textfield

Wondering if there are any best practices or recommended strategies for addressing this particular scenario. At the moment, I am using the following Material-UI packages: "dependencies": { "@emotion/react": "^11.11.1", ...

Building a responsive CardMedia component with React Material UI

I am currently working on creating a gallery using React Material UI (utilizing Card, ...). I am facing some challenges in making the gallery responsive, especially with varying cover sizes: https://i.stack.imgur.com/2n6vf.png Here is the code snippet I ...

If the MUI autocomplete is unable to retrieve the value from the multiple attribute, it will either return 0 or remain undefined

When using the MUI Autocomplete component with the 'multiple' attribute, the value prop may return 0 or undefined when selecting an option. <Autocomplete value={v.education} onChange={handleEducationChange} className={classes.textOutline} multip ...

What causes Material-UI to fail while being used inside React Router?

I am attempting to integrate material-ui with react-router and came across this example that seems to work smoothly: import { Router, Route, IndexRoute, browserHistory } from 'react-router'; import getMuiTheme from 'material-ui/styles/g ...

Struggling with Material-UI DataGrid's sorting issue in numeric columns

I am currently working on a project involving the DataGrid Component from Material-UI. While data can be displayed, I am encountering issues with the built-in sorting feature. When attempting to sort in ascending or descending order, it seems to be priorit ...

Testing Library for React and Material-UI Tooltips

Currently, I am experimenting with an Info HOC in my React app: const InfoHOC = (HocComponent) => ({ message }) => ( <> <Tooltip title={message}> <InfoIcon /> </Tooltip> {HocComponent} </> ); ex ...

Is it possible to scope component styles instead of using inline styles in order to avoid being overwritten by multiple React applications on a single webpage?

My application contains the following HTML: <div id="react-root-navbar"></div> <div id="react-root-body"></div> Along with React components that utilize React.DOM.render on each div. Both React components utili ...

Does react-tap-event-plugin serve a purpose in the current year of 2018?

Does React still require the use of zilverline's tap event plugin or has it been integrated directly into React's source code, eliminating the need for a tap delay? ...