Left-align the tab elements

I am looking to customize this example for Vertical tabs.

Sandbox: https://codesandbox.io/s/v0p58

My goal is to have the tabs aligned on the left side. I attempted to include: alignItems: 'left'

tabs: {
    borderRight: `1px solid ${theme.palette.divider}`,
    overflow: 'visible',
    alignItems: 'left'
  },

However, this approach did not yield the desired outcome. Is there a way to remove uppercase configuration?

Answer №1

align-items in a flex container (with default flex-direction: row) aligns the items on the Y axis, not the X axis.

For alignment on the X axis, use justify-content.

You can customize the appearance of MuiTab-wrapper like this:

 tabs: {
     "& .MuiTab-wrapper": {
       flexDirection: "row",
       justifyContent: "flex-start"
     },
     textAlign: "left",
     borderRight: `1px solid ${theme.palette.divider}`
  }

Take a look at the example on codesandbox

To style the right border (referred to as the 'indicator'), define a class rule and apply it to the indicator element

Here's an example:

 indicator: {
     left: 0,
     // add any other necessary styles here such as changing the backgroundColor
  },
 .... add styles for other classes as needed

In your JSX code, include TabIndicatorProps within the <Tab component

  <Tabs
    orientation="vertical"
    variant="scrollable"
    value={value}
    onChange={handleChange}
    aria-label="Vertical tabs example"
    className={classes.tabs}
    TabIndicatorProps={{ className: classes.indicator }}
  >

To convert the text to lowercase, simply add textTransform: 'lowercase' to the styles of MuiTab-wrapper

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

How to prevent the scroll bar from affecting a fixed div located at the top of the page

Check out this website: I am struggling with setting up a fixed menu div at the top and a content div below it on my site. I want the scroll bar to only apply to the content div and not the header div at the top, but I can't seem to figure out how to ...

A step-by-step guide on clearing a TextInput programmatically with the help of

Is there a way to automatically clear the TextInput after submitting the form using useRef? const inputRef = useRef() I have tried the following code to clear the input field, but it is not working: const clearInput = () => { inputRef.cur ...

Edge Runtime does not permit the use of Dynamic Code Evaluation functions such as 'eval', 'new Function', and 'WebAssembly.compile'

My project involves the implementation of NextUI components. I incorporated the Select component from NextUI, and during development mode, everything functioned flawlessly. However, upon completion of development and attempting to build the project, I enc ...

How can an array of objects be sent as a query string to the endpoint URL in React?

I'm currently developing a react application and facing the challenge of dynamically constructing and appending query strings to URLs. This is necessary because I have a shared base endpoint for all links, but each link may require different parameter ...

What are some ways to add border styles to the Material UI TableRow Component?

In my project, I am utilizing the Table component from Material UI. I have been trying to apply border styles to the TableRow Component using scss classNames for styling purposes. Usually, the border styling is applied in the TableCell, but this doesn&apos ...

Efficient ways to fetch multiple Firestore collections in a single field using React Native

Is there a way to call multiple collections from Firebase in order to display items from those collections on my home page? I have two collections, salati and recipes, each with their own documents. However, I am unsure if it is possible to call them in a ...

Having a floating left <UL> list with floating right text boxes positioned below the UL list instead of being set next to it

I'm attempting to align an unordered list on the left and a group of textboxes on the right within a div tag. The problem I'm facing is that the text boxes are positioned below the list items instead of being adjacent to them. .PersonLI { flo ...

What is the best way to generate a comprehensive listing of all external components integrated into a Java and React project?

To comply with legal requirements, we must disclose all open-source components utilized in our project. This is a commercial project that combines Java and React, and utilizes Gradle, npm, and Yarn. Is there an efficient way or tool available to extract t ...

Are there any performance implications when using an excessive number of background images in CSS?

My website seems to be running too slowly based on user reports. I suspect that the background images in CSS may be causing the issue. The site uses a custom build system to concatenate and compress all CSS, create CSS sprites automatically, resulting in ...

Tips for merging two arrays in NextJS?

I need help with a minor issue I'm facing. In my app, I am creating data tables and retrieving data from two different API endpoints. The first endpoint returns data like this (e.g. offers): { id: 1, product_id: 1, name: 'some name', et ...

What is the best way to ensure a div takes up the rest of the height on a page when the header's size is unpredictable

Is there a way to make the red area fill the remaining visible space without overlapping into the footer? I also need the infoContent section to be scrollable. The height of the header may vary. I came across some older solutions that suggested using Java ...

Merging the worldwide redux store with the component's individual state

One issue I encountered involves utilizing the global store slice 'genres', which is an array of objects, in a local state to manage the checkboxes' check/uncheck functionality. The problem arises when attempting to use props.genres in the i ...

Ensure that the child element maintains equal height and width measurements within a row that is distinct

Is there a way to arrange 4 items inside a flex container in a 2 X 2 grid layout while ensuring that they all have the same width and height? I've tried using flex-grow: 1;, but since the children are in different flex containers, they do not obey th ...

Could I potentially oversee the installation of a package that exclusively includes a single component from Material-UI?

I am looking to streamline my package installation process by only including the specific Material-UI component I need rather than the entire big package. Is there a way to install just the individual component I want to use, such as: import Button from ...

Align a span vertically within a div

I need help aligning the content "ABC Company" vertically within a div using Bootstrap 4's alignment helper classes. Despite my efforts, I have not been successful. Here is the code I am using: <div class="container" style="width: 740px;"> < ...

The Mui Select element is encountering issues with values outside the specified range in a dynamically updating selection component

Issue regarding dynamic select component filtering duplicate values and preventing out of range error. const groupsOptions = ['a','b','c','d','e','f'] const addedValue = // this will give al ...

Is there a way to implement a collapse/expand feature for specific tags in React-Select similar to the "limitTags" prop in Material UI Autocomplete?

Utilizing the Select function within react-select allows me to select multiple values effortlessly. isMulti options={colourOptions} /> I am searching for a way to implement a collapse/expand feature for selected tags, similar to the props fun ...

Encountering a connection issue while attempting to install styled components using npm

Hello everyone, I am currently in the process of setting up my development environment. To start off, I created a new React project using npx create-react-app PROJECTNAME Now, I'm exploring the use of Styled Components. However, when I try to inst ...

What is the best way to conceal a sticky footer using another element?

I have a footer that remains fixed at the bottom of both long and short pages. Below is the CSS code for this footer: .footer{ position: absolute; bottom: 0; width: 100%; height: 100px; background-color: white; } My goal is to achieve a 'r ...

Issue with border rendering on triangles in CSS on IE8

I currently have a horizontal navigation bar with triangle borders inserted using :before and :after for each list item. This creates the illusion of a white bordered point on the right side of each list item. The issue I'm facing is that this design ...