After receiving assistance from others on the thread about Creating a Material-UI tab with image tabs instead of text labels, I was able to successfully implement images for my Material-UI tabs. However, I am facing an issue where I am unable to control the width of the tabs regardless of the size of the images. The tabs expand in width if the images are larger.
To demonstrate the problem, I have created a Code SandBox at https://codesandbox.io/s/lucid-stonebraker-q1r4v?file=/src/App.js.
While I tried to set the tab width using inline styles, it only resulted in clipping the content to the right rather than centering the image in the narrower tab.
Without the inline style, there is a responsive breakpoint at around 600 pixels. Below the breakpoint, the tab width is approximately 72 pixels, while above the breakpoint, it increases to about 160 pixels. Even if I manually set the width with inline styles, the image seems to shift at the breakpoint as if the underlying width for image centering remains the original tab width.
I chose these specific width values because they aligned closely with the min-width values in the Material-UI tab.js source code. Despite my attempts to modify these values in the source code, they had no impact on the breakpoint behavior, so I reverted the file to its original state.
If feasible, I would like to have the flexibility to set the tab width, margins, and padding according to my requirements while ensuring that the images remain centered in the result.