Vertical MudSlider built-in label/value do not work well for standard top/slider/bottom layouts
Problem and use case
MudSlider with Vertical="true" is difficult to use in a common vertical control layout where the control needs:
- a persistent label above
- the slider in the middle
- a persistent value below
What happens
Using the slider's built-in mechanisms does not work cleanly for this layout:
ChildContentbehaves like a label, but it is rendered inside the slider root.- The vertical slider is implemented by rotating the slider root with CSS.
ValueLabelis a thumb/value popup, not a persistent value display below the control.
As a result, a vertical MudSlider cannot naturally provide a clean top / middle / bottom composite layout using normal MudStack / flex layout alone.
Why this appears to happen
From the MudBlazor implementation, the vertical slider uses CSS rotation on the root element:
.mud-slider.mud-slider-vertical {
transform: rotate(270deg);
height: 100%;
width: unset;
}Because transform is applied after layout, the slider's visual position does not match its layout box in the same way as a naturally vertical control.
Tiny repro
<MudStack AlignItems="AlignItems.Center" Style="height:200px; width:80px;">
<MudSlider T="int"
Value="4"
Min="1"
Max="8"
Step="1"
Vertical="true"
TickMarks="true">
Speed
</MudSlider>
<MudText Typo="Typo.caption">4</MudText>
</MudStack>Expected behavior
A vertical MudSlider should support a simple vertical composite layout such as:
- label above
- slider centered vertically
- persistent value below
without requiring absolute positioning or custom transform compensation.
Actual behavior
To achieve this layout, we had to:
- stop using the slider's built-in label/value for the vertical layout
- render separate external label and value elements
- create a fixed-height slider slot
- add custom CSS to compensate for the rotated root element
Version
Observed with MudBlazor 9.10.0.
Proposed solution
Request
Please consider one or more of the following:
- improve built-in label support for vertical sliders
- provide a built-in persistent value display option for vertical sliders
- make the vertical slider's visual box align more naturally with its layout box in flex /
MudStackcontainers - document this limitation/workaround if the current behavior is by design
Source: MudBlazor/MudBlazor