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

Unable to show the table row color using Angular in Internet Explorer

I've customized a table by changing the row color based on a property value, and I'm using ng-repeat to display the rows. Here's my table: <table class="tab table span6 tabhover" style="margin:0;" > <thead> ...

Sequentially loading Bootstrap columns as the page loads

Is there a way to load columns one by one with a time gap when the page is loaded? Here's the code snippet that can achieve this: setTimeout(function() { $("#box1").removeClass("noDisplay"); },1000); setTimeout(function() { ...

Is it possible for JavaScript to identify modifications in the HTML, like an input made with Ctrl+Shift+I?

Check out this website I'm currently working on. As a fun challenge for users, we're encouraging them to use ctrl+shift+i to manipulate the HTML and modify certain elements. Is it possible for Javascript or CSS/HTML to detect these changes? For ...

The temporary drawer is causing issues with the functionality of the Material-UI datagrid filter

When utilizing the datagrid component within a 'temporary' drawer (using the drawer's variant prop set to temporary), I've encountered an issue where the filter functionality is not working. Switching the drawer variant to 'permane ...

Is there a way to insert a dot after every two digits in a text field using Javascript upon keypress?

When inputting a 4-digit number (e.g. 1234) in my text field with value format 00.00, I want it to automatically adjust to the 12.34 format. How can I achieve this behavior using JavaScript on keyup event? ...

Initially, the 'display none' CSS command may not take effect the first time it is used

I am currently working on a slideshow application using jquery.transit. My goal is to hide a photo after its display animation by setting the properties of display, transform, and translate to 'none' value. Although the slideshow application work ...

Establish initial content for the specified div area

I need help setting page1.html to display by default when the page loads. Can you provide some guidance? Appreciate your assistance in advance. <head>     <title>Test</title>     <meta http-equiv="content-type" content="tex ...

Troubleshooting the functionality of the Material-UI LinearProgress bar

I've recently implemented a simple file upload feature using the react-dropzone library in my project. To enhance this functionality, I decided to incorporate the material-ui LinearProgress bar to visually represent the upload progress. Below is the ...

Include money symbols within input fields with padding and vertical alignment

I am looking to create an input field that includes either € or $ currency symbols. The challenge is ensuring perfect vertical centering inside the input, especially when using padding. Is there a foolproof method to achieve this? https://i.stack.imgur ...

What strategies can be utilized to raise the max-height from the bottom to the top?

I am facing the following coding challenge: <div id = "parent"> <div id = "button"></div> </div> There is also a dynamically generated <div id="list"></div> I have successfully implem ...

Content not aligned in the center of the page on Internet Explorer

Recently, I've taken on the responsibility of managing the content for this website after it was passed down from the previous developer. Each page's content is contained within a div element with the class "ct", which has auto margins applied t ...

Center-align an input and button vertically within a div

I am facing an issue with aligning my search setup vertically inside a div Below is the code I have written: HTML: <div class="search"> <input class="searchfield" type="text" placeholder="Search..." value="" />&nbsp;<button class="sea ...

Revamping the Look: Refreshing Background of Div

I'm attempting to change the background image of the body element on a webpage when I hover over links with data-* attributes. It's working perfectly, but I can't seem to figure out how to create a smooth fade between the images when a link ...

Positioning of buttons within a div

I am currently designing an inspiration post style: https://i.stack.imgur.com/I5J0H.png However, I am encountering some challenges while creating it: The buttons are not rounded when the window size is changed Social icons are not being displayed I am ...

Dragging a div element within a table

I am working on an HTML code where I need to make the colored divs draggable and fit them into specific table cells. The green div should occupy 2 cell spaces, light blue 3 cell spaces, yellow 4 cell spaces, and dark blue 5 cell spaces. While I have the d ...

How can I retrieve the reference number of an item by clicking a button within a list item in an unordered

Presented here is a collection of data points and a button nested within an ul <ul> <li class="mix" category-1="" data-value="600.35" style="display:block;"> <figure> <figcaption> <h3> ...

The layout causes issues with responsiveness on the Flask app page

I'm currently in the process of developing a web application and I've implemented a navbar.html file as the layout for each page using the following code: eachpage.html : {% extends 'navbar.html' %} {% block body %} <div class=" ...

VSCODE's intellisense feature seems to be ignoring CSS code within JSX files

I've been puzzling over why Visual Studio Code isn't recognizing CSS syntax inside JSX files. While I'm typing, CSS IntelliSense doesn't provide suggestions for CSS - only Emmet suggestions.https://i.stack.imgur.com/FegYO.png Despite t ...

Tips for efficiently exporting and handling data from a customizable table

I recently discovered an editable table feature on https://codepen.io/ashblue/pen/mCtuA While the editable table works perfectly for me, I have encountered a challenge when cloning the table and exporting its data. Below is the code snippet: // JavaScr ...

Can CSS be used to target HTML elements that come after another regardless of their position in the document?

Is there a way to style any <h1> element(s) that come after an <h2> element using only CSS? I've searched through countless pages of CSS documentation, trying to figure out if it's possible to target specific elements that appear AFT ...