Material UI's Paper component is not expanding to full width when viewed on a smaller screen size

I'm currently working on a website project and utilizing a component for displaying dark mode. However, I've encountered an issue where the Component shrinks excessively when the screen size goes below 600px, unlike other components.

This is a snippet of my app.js file:

function MyApp({ Component, pageProps }) {
  return (
    <>
      <Head>
        <meta name="viewport" content="initial-scale=1.0, width=device-width" />
      </Head>
      <ThemeChanger>
        <Paper square elevation={0}>
          <Layout>
            <Component {...pageProps} />
          </Layout>
        </Paper>
      </ThemeChanger>
    </>
  );
 }

Check out these sample images for reference:

UI image at a width greater than 700px:

https://i.stack.imgur.com/6dBwI.png

UI image at a width less than 600px:

https://i.stack.imgur.com/Ua3yM.png

Here are some approaches I've already attempted: - Adding flex and min-width: "100%" to the component - All other components are functioning correctly, except this one

Technologies used in the project: - NextJS v11 - Material Ui v5

Answer №1

Unable to locate the resolution by simply scanning through the entire css code.

It seems to me that the constraints on the size of a parent element are preventing the child element from expanding. If the parent element has a fixed size or does not have 100% width, the child element will not be able to occupy the full width.

Examine the element on both screens and identify which css property is restricting the width to 100%.

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

Steps for embedding a dynamic 3D model onto a website with THREE.js

Seeking guidance on integrating animated 3D models onto a webpage using THREE.js. Currently, I have successfully loaded a static 3D model named 'aaa.gltf' with auto rotation and orbit control functionality. However, when trying to load another an ...

css based on the current time in the United States

I have a working code that currently reads the user's computer time, but I specifically need to get the hours from the USA regardless of the user's location. The CSS should be applied based on USA time. <script type="text/javascript"> dat ...

Issue with customizing Bootstrap5 table colors based on themes

In my latest project, I decided to customize Bootstrap 5.1.3 using Sass in order to introduce some new color themes to the panels. I quickly realized that customizing Bootstrap 5.1.3 is not as straightforward as it was with Bootstrap 4. After updating my ...

"Exploring the versatility of using variables in jquery's .css

I’m facing an issue where I need the rotation of a div to be based on the value stored in "anVar." This is what I currently have: function something() { $('.class').css('-webkit-transform:rotate('anVar'deg)') } The desi ...

When a block is clicked, jQuery will reveal that block while hiding the others sequentially, starting with the second block, then the third, and finally the fourth

Creating a navigation menu with 4 blocks can be a bit tricky, especially when trying to show one block at a time upon click. Here is my code attempt, but unfortunately it's not working as expected. I would greatly appreciate any help or suggestions on ...

Discovering active path while utilizing dynamic routes - here's how!

Whenever I click on the project element in my HeadlessCMS with the URL /projects/slug-name, the projects button in my Navbar (LinkItem) does not highlight with a background color (bgColor). How can I modify this line of code: const active = path === href / ...

React: Retrieving information post `componentDidMount`

Seeking advice on React data fetching best practices. Common tutorials recommend fetching data in the componentDidMount lifecycle method. This results in a lifecycle that looks like this: render componentDidMount fetch ... setState render Now, I ha ...

Solving problems with React's Material UI Grid and useStyles prop

Exploring materialUI for the first time and created a grid of cards with styling in the same component. Decided to move all the useStyles styling to a separate file. Encountered an issue where backgroundColor styling wasn't rendering across component ...

Fade-in animation of a clock on an SVG image

I am trying to achieve a unique fade-in effect for an SVG image in my HTML. The challenge is to make the fade-in start from the top of the image and progress in a circular motion until it completes a full circle. An example of the effect I am aiming for is ...

Styling elements using flexbox and various other divs

Looking to style a webpage with CSS to achieve this particular layout: https://i.sstatic.net/K3x0A.png The objective is to make the page responsive where the red and blue columns (left and right) have fixed widths. The center column should be collapsible ...

What is the best way to retrieve classes from arrays and apply styling to them using javascript?

Imagine having 3 unique classes: alpha, beta, and gamma. Each class contains 3 individual div elements like so: <div class="alpha"></div> <div class="alpha"></div> <div class="alpha"></div> <div class="beta">< ...

The message from create-react-app states, "To use Create React App, you must have Node version 14 or higher installed." However, when attempting to update Node, an error message pops up saying, "npm does not work with

I encountered an issue while attempting to develop a react app, and received the following message: $ npx create-react-app react-demo npx: installed 67 in 6.045s You are running Node 10.19.0. Create React App requires Node 14 or higher. Please update your ...

Creating a User-friendly Layout for Admin Pages in Next.js Version 13

Hey there, I'm facing an issue with the layout while using Next.js 13 Experimental App Directory. On my website's index page or routes '/', I want to show a landing page and use a specific layout for all pages except for those under the ...

Tips for submitting multiple radio button values in a tabular format

HTML Code: <div class="tab"><h4>Zip Code</h4> <p><input type="text" class="text1" placeholder="Enter zip code..." oninput="this.className = ''" name="zipcode"></p> </div> <div class="tab">& ...

The DIV refuses to center-align

I am struggling to center a div element. I have tried using margins (margin: 0 auto) and left/right CSS attributes (left: 50%, right: 50%), but the result is not as expected. Can anyone point out where the problem might be? EDIT: The issue I'm facin ...

Alert: The route "/D:/original/22-02-2017/job2.html" specified in [react-router] does not correspond to any existing routes

I am currently working on a project using TypeScript with React. I'm utilizing webpack as a compiler, and my directory structure looks like this: d:/original/22-02-2017/ - In my web.config.js file, the entry point is set to ./src/index.tsx. All ...

Can I fetch the visible rows (along with their order) from a React Material-table?

I've recently started working with React and I'm utilizing a special component known for its unique filtering functionality that I couldn't find elsewhere. This component typically shows 10 rows of data by default. Whenever I apply filters ...

Image control failing to display SVG file

I am facing an issue with displaying an SVG file on the img control in angular10. When I try to use SVG, it's not showing up but it works fine when I change the file type to jpg for the same control. The img control is placed inside a nav bar. Here i ...

By default, the first table row is displayed when using table grouping in AngularJS

I am attempting to display only the first tr in the table and hide all other tr elements by default. I have tried using ng-show and ng-hide but it does not seem to be working as expected. This is not originally my plunker; I used it for reference on group ...

Executing a Python script on the server via user interaction in a Django-React project: What's the best approach?

I'm currently working on integrating a Python script to run in the backend when a user inputs certain numbers into a form using React. My application is structured with Django handling the backend operations and React managing the frontend interface. ...