The TextField component in MUIv5 is showing some frustrating white space in the corners

I've integrated the MaterialUI_v5 library and included a TextField component within a Paper component.

The background of the Paper component has been customized to appear in a shade of green.

For the Textfield component, I have applied a styling that sets its color to white.

However, there seems to be some unwanted white space around the edges of the Textfield component that I would like to make green (see image below).

Here are the current props for the Textfield component:

<TextField className={styles.input} label="First Name" variant="outlined" size="small" />

And the corresponding styling is as follows:

.input{
    background-color: white;
    width: 400px;
}

https://i.sstatic.net/aMEY6.png

Answer №1

The container with input has now been modified with a border radius. To make further changes, update the styles of the container by replacing the class from .input to .MuiOutlinedInput-root

.MuiOutlinedInput-root {
  background-color: white;
  width: 400px;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Strategies to avoid duplication of items when utilizing Redux Toolkit in conjunction with Strapi and React

Can someone please help me with a shopping cart issue I'm facing? My items keep duplicating in the cart and I can't figure out why. Any guidance would be greatly appreciated! Here is a snippet of my code : CartReducer.js import { createSlice } ...

Creating a 2x2 grid layout with flexbox styling

Having trouble creating a customized 2 by 2 grid using flexbox at the moment. Here is my goal: https://i.sstatic.net/uiGOD.png The height of 1 and 2 should be smaller than 3 and 4. And the width of 1 and 3 should be wider than 2 and 4. I attempted to a ...

Text Box: Add a touch of flair with resizing

One interesting feature on my webpage is a textarea that can be resized using resize:both; I am looking for a way to apply a specific style to this textarea only when the user resizes it. While I would prefer to achieve this with CSS alone, it seems like ...

What could be causing OnChange to malfunction within Formik?

Formik in React is giving me trouble while working on a dummy app. When I set the value prop for the input boxes, I am unable to type anything. However, if I remove the value props, I can type but it doesn't reflect in the values when submitting. Tak ...

"Custom JSS Styles in Material-UI are cleared when a Component Is Re-Rendered

In my current setup, I have a Drawer that contains Tabs. An issue arises when the Drawer is open and the color theme is changed; the custom styles for one component in the tab are removed, causing a break in the styling. Interestingly, this problem only oc ...

Is there a way to incorporate CSS or tables when converting HTML to PDF using JavaScript?

While working on a project, I successfully converted an HTML file into a PDF. However, the output did not display the CSS design. Can anyone provide suggestions on how to include CSS design in the PDF file? Below is the JavaScript function code: $(funct ...

Restricting Horizontal Scrolling in Dash DataTable with multi-tiered header (without any additional empty gaps)

I'm currently developing a Dash application using Plotly that showcases two tables, specifically dash_table.DataTable, each with multiple columns. The initial table features a multi-level header. For both tables, the first few columns are fixed while ...

The PurgeCSS CLI does not generate CSS files beyond the command line interface

I'm struggling to successfully extract my CSS using purgecss from the command line and save it to a separate file. The instructions on PurgeCSS.com are vague: By default, the CLI only outputs the result in the console. To save the purified CSS files ...

Personalized design for the range input in React

I am working on a React component that includes an input range element. I have used some CSS to style it vertically and currently, it looks like this: https://i.stack.imgur.com/WmQP4.png My goal is to customize the appearance of the slider so that it res ...

Switching the checkbox value upon clicking a div element

One challenge I am facing is with a checkbox that saves its value and title in the local storage when clicked. This checkbox is located within a div, and I want the checkbox value to change whenever any part of the div is clicked. Despite my efforts, I hav ...

The inexplicable failure of Next.js in executing getServerSideProps

Currently, I am in the process of learning NextJS. As part of this journey, I have an API built using Laravel that features an endpoint /api/user. This endpoint is protected with a token and returns a basic user object structured as follows; { "da ...

Formik resetting value on onBlur when downshifting autocomplete

I am currently working on a form that requires an API call to display suggestions in one of the fields. The user should be able to select from these options or input their own value, which will then be used when submitting the form. However, this field is ...

What are the best ways to prevent JavaScript and CSS from blocking the render?

I ran my webpage through Google PageSpeed Insights and it keeps flagging an issue with render-blocking JavaScript and CSS in the above-the-fold content. The report indicates that there are 17 blocking scripts and 11 blocking CSS resources on the page. De ...

Tips for dynamically retrieving a CSS file for an HTML page

With multiple html pages containing the same navbar, I made the decision to place the navbar in its own file called navbar.html and use ajax with jquery.get() to dynamically load it onto each page. This prevents redundant code across all pages. Currently, ...

Using ReactJS to capture keydown events from an iframe

I am trying to implement keydown event handling for an iframe within a ReactJS component. The iframe contains an embedded video, and I want to be able to capture keyboard events while the video is playing. Can someone please assist me with how to achieve ...

What could be the reason for the malfunction of jQuery's show() function?

Using jQuery, I have implemented a functionality to hide a div using the hide() method. However, upon clicking a link, the div is supposed to show but unexpectedly disappears after appearing briefly. HTML Code Snippet <div id="introContent"> & ...

Challenge with Updating React Components When Switching Themes

In my React application, I'm facing a challenge with theme switching. There are two themes available: Theme One and Theme Two. To dynamically load theme components, lazy loading has been implemented based on the selected theme. Each theme has its own ...

I am having trouble applying styles to this div tag in the CSS file, as it seems to only work when styling directly in the HTML

In my Search.js file, I have a container for styling the text box that will be displayed in my Home.js file. import React from 'react'; import './Search.css'; import SearchIcon from '@material-ui/icons/Search'; import MicI ...

What could be causing my React Router to fail in displaying the content of Home.js?

My <Route> is not functioning as expected The Route leading to the homepage does not show the content from the Home.js file import "./App.css"; import Navbar from "./components/Navbar"; import { BrowserRouter as Router, Route, Ro ...

Guide to successfully setting up a Json server and ReactJS to run simultaneously on the same port

Currently, I am facing an issue while attempting to run my React application with a JSON server as the backend API. The problem arises when trying to run them on different ports due to a CORS error. I am currently seeking advice and looking for a solutio ...