Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9243,6 +9243,11 @@
Default is <see cref="F:Microsoft.FluentUI.AspNetCore.Components.Orientation.Horizontal"/>.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentStack.Reversed">
<summary>
Gets or sets a value indicating whether the stack is reversed.
</summary>
</member>
<member name="P:Microsoft.FluentUI.AspNetCore.Components.FluentStack.Width">
<summary>
Gets or sets the width of the stack as a percentage string (default = 100%).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<div style="width: 150px;">
Vertical<FluentListbox Items=@(Enum.GetValues<VerticalAlignment>()) @bind-SelectedOption="@Vertical" />
</div>
<div style="width: 150px;">
<FluentSwitch @bind-Value=Reversed Label=" Reversed" />
</div>
</FluentStack>

<p>Result:</p>
Expand All @@ -19,6 +22,7 @@
<div class="demopanel">Vertical item 1</div>
<div class="demopanel">Vertical item 2</div>
<FluentStack Orientation="Orientation.Horizontal"
Reversed="@Reversed"
HorizontalAlignment="@Horizontal"
VerticalAlignment="@Vertical"
HorizontalGap="4"
Expand All @@ -32,4 +36,5 @@
{
HorizontalAlignment Horizontal;
VerticalAlignment Vertical;
}
bool Reversed;
}
4 changes: 2 additions & 2 deletions src/Core/Components/Stack/FluentStack.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

@inherits FluentComponentBase

<div id="@Id" class="@ClassValue" style="@StyleValue" @attributes="AdditionalAttributes">
<div id="@Id" class="@ClassValue" style="@StyleValue" @attributes="AdditionalAttributes" reverse="@(Reversed == true ? "true" : "false")">
@ChildContent
</div>
</div>
6 changes: 6 additions & 0 deletions src/Core/Components/Stack/FluentStack.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ public partial class FluentStack : FluentComponentBase
[Parameter]
public Orientation Orientation { get; set; } = Orientation.Horizontal;

/// <summary>
/// Gets or sets a value indicating whether the stack is reversed.
/// </summary>
[Parameter]
public bool? Reversed { get; set; } = null;

/// <summary>
/// Gets or sets the width of the stack as a percentage string (default = 100%).
/// </summary>
Expand Down
14 changes: 12 additions & 2 deletions src/Core/Components/Stack/FluentStack.razor.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
ο»Ώ.stack-vertical {
.stack-vertical {
display: flex;
flex-direction: column;
}

.stack-horizontal {
display: flex;
flex-direction: row;
}
}

.stack-vertical[reverse='true'] {
display: flex;
flex-direction: column-reverse;
}

.stack-horizontal[reverse='true'] {
display: flex;
flex-direction: row-reverse;
}