The Width of Material UI Divider

Currently seeking a method to increase the line thickness of the Material UI Divider, whether by stretching horizontal lines vertically or stretching vertical lines horizontally.

I have reviewed the documentation for Material UI v5 on https://mui.com/material-ui/api/divider/.

Despite checking the API, there does not seem to be an attribute available to adjust the Divider's "Thickness."

Various attempts with inline styles specific to Material UI v5 have been made:

<Divider sx={{height:"15px", fontSize:"50px", width:"50px", fontWeight:"bold", padding:"15px"}}/>

Regrettably, none of these attributes have successfully altered the "thickness" of the line.

In search of a solution tailored to the Material UI v5 Divider component specifically. Preferably without resorting to creating a Box component and applying inline sx attributes or custom classes to said Box component.

Any suggestions or ideas are greatly appreciated!

Answer №1

To adjust the thickness of the divider, you can modify the CSS property border-bottom-width:

<Divider sx={{ borderBottomWidth: 5 }} />

If you need a vertical divider, use the following code:

<Divider orientation="vertical" flexItem sx={{ borderRightWidth: 5 }} />

You can also customize the thickness of the divider using styled():

const StyledDivider = styled(Divider)(({ thickness, orientation }) => ({
  ...(thickness !== undefined &&
    (orientation === "vertical"
      ? { borderRightWidth: thickness }
      : { borderBottomWidth: thickness }))
}));
<StyledDivider thickness={10} />
<StyledDivider orientation="vertical" flexItem thickness={10} />

https://codesandbox.io/s/69682476-mui-material-ui-divider-thickness-s41mn?file=/demo.js

Answer №2

Now that's one hefty lad

<Separator styling={{ borderBottomWidth: '45px' }} />

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

Guide to automating the versioning of static assets (css, js, images) in a Java-based web application

To optimize the efficiency of browser cache usage for static files, I am seeking a way to always utilize cached content unless there has been a change in the file, in which case fetching the new content is necessary. My goal is to append an md5 hash of th ...

Acquire row data when checkbox is selected in MUI X Data Grid

Utilizing React MUI X DataGrid, I am fetching data from an API and displaying it. Check box selection is enabled, and I want to retrieve specific cell items from the selected row and store them in a list. For example, if I click on the checkbox for the 1s ...

What could be the reason behind the malfunctioning of my media query in the

I am trying to connect an external stylesheet to my React component in order to apply different styles based on screen width. Specifically, when the screen width is less than 300px, I want the logo to have a height of 100vh. However, it seems that the medi ...

While iterating through the material-ui rating component, the 'index' value remains constant at 0 within the 'onChange' function

For my e-commerce React.js web app, I want to show the rating value of each product. Using the JS map function, I was able to track which product was hovered by its index ('onChangeActive' is the handler for this). {products.map((product, index) ...

When using Material-UI's <Table/> component, an error is thrown stating that the element type is invalid

Struggling with material-ui Table is not familiar territory for me, especially since I have used it in numerous projects before. Currently, I am utilizing @material-ui/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="33505c41567 ...

Creating Awesome Icons in Kendo Grid with Code In this tutorial, we will learn how to programm

Looking to have a Kendo grid display a green fas-fa-clock icon if isActive is true, and a grey far-fa-clock icon if false. Clicking on the icon should toggle between true and false. Currently, the grid just shows the word true or false in the column. Cod ...

Tips for setting discrete mapper style in cytoscapejs?

Currently, I am defining the style of cytoscape.js through CSS and converting it to JSON format using this resource. My goal is to implement a discrete mapper for styling. It's similar to the scenario discussed in How to use a descreteMapper like on c ...

Tips for creating a dynamic variable for an object key in jQuery to streamline your code

Utilizing the TweenMax library, I am adding styles to a div while scrolling. However, I am facing a challenge where I need different styles based on varying page resolutions. To address this issue, I implemented an if condition. Is there a way I can use a ...

Maximizing the Efficiency of Imports in ReactJS

Choice 1: import { Checkbox, FormControlLabel } from '@mui/material'; Choice 2: import { Checkbox } from '@mui/material'; import { FormControlLabel } from '@mui/material'; Which option do you prefer? Explain your reasoning. ...

Difficulty Clicking Links with CSS 3D Transformation

I'm currently working on implementing a CSS 3D transform effect on my website. However, I am encountering some issues with clicking the links once the card has been flipped over. Question Why is this happening? How can I resolve this so that I can ...

Enhance the bubble charts in Kendo UI Graph by adding dimension and depth to the bubbles for a more visually

Is there a way to create a relief effect on the bubbles in Kendo UI Bubble charts? Currently, all bubbles appear flat with the 15 provided themes. You can see an example here: It would be great to have a 3D-style option similar to the pie chart (Uniform s ...

The Microsoft Booking feature is not being shown in the iframe

Instead of the booking website, this is what is being displayed. Below is the code snippet: index.js import React from 'react' const Appointment = () => { return ( <iframe src='https://outlook.office365.com/owa/calendar/<a ...

Aligning a block of text containing two varying font sizes in the center

I'm attempting to center a paragraph element with a span inside that has a different font size, causing the alignment to be slightly off. Below is the HTML code: <p class="priceWrap"><span class="moneySign">$</span>60000.50</p> ...

Conceal a particular object from view by selecting it from the menu

I want to hide a specific element when the burger button is clicked. (See CaptureElementNoDisplay.PNG for the element to hide) When I click the burger button again to close the menu, I want the hidden item to be displayed once more. I've successfull ...

How can we target every nth child element universally?

I am working with an HTML structure that has a specific layout, and I need to target all odd <span> elements globally without considering their parent elements. Is there a way to style 1, 3, 5, 7, 9 in red color? I attempted to use :nth-child(odd) b ...

Populate two MUI-Autocomplete fields by selecting one item

Is it possible to have two different Autocomplete components on the same row within a table? I'm unsure if this can be done, and how to execute it based on the example provided below. [Feel free to check out the sandbox for more context] sandbox A ne ...

Displaying and concealing a component using onClick in React with Material UI

I want to create a functionality where the Material UI Box component opens when clicking on a Button and closes when clicking on the Button again. I have searched for solutions on Google but couldn't find anything straightforward. I am looking for a s ...

Display validation messages when the user either clicks out of the textbox or finishes typing

Here are some validation messages: <form name="dnaform" novalidate> <div style="padding-bottom:5px" ng-show="dnaform.uEmail.$pristine || dnaform.uEmail.$valid">Active directory account </div> <div style="padding-bottom:5px;" n ...

The challenge of navigating CSS specificity guidelines

In my CSS file, I have defined two styles for a table with the class "myTable". The first style sets the background color of header cells to gray, while the second style sets the background color of odd rows to blue: .myTable th { background-color: gr ...

HTML input field's placeholder text is truncated at the end

My HTML input form has a field with placeholder text that extends beyond the padding and gets cut off at the end. https://i.sstatic.net/9r46F.png I am unable to pinpoint the source of this issue. ...