diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Layouts/Stack/BitStack.cs b/src/BlazorUI/Bit.BlazorUI/Components/Layouts/Stack/BitStack.cs
index 54b7e6340b..676ea7a8a7 100644
--- a/src/BlazorUI/Bit.BlazorUI/Components/Layouts/Stack/BitStack.cs
+++ b/src/BlazorUI/Bit.BlazorUI/Components/Layouts/Stack/BitStack.cs
@@ -1,4 +1,5 @@
-using Microsoft.AspNetCore.Components.CompilerServices;
+using System.Diagnostics.CodeAnalysis;
+using Microsoft.AspNetCore.Components.CompilerServices;
namespace Bit.BlazorUI;
@@ -7,6 +8,19 @@ namespace Bit.BlazorUI;
///
public partial class BitStack : BitComponentBase
{
+ ///
+ /// Gets or sets the cascading parameters for the stack component.
+ ///
+ ///
+ /// This property receives its value from an ancestor component via Blazor's cascading parameter mechanism.
+ ///
+ /// The intended use is to allow shared configuration or settings to be applied to multiple stack components through the component.
+ ///
+ [CascadingParameter(Name = BitStackParams.ParamName)]
+ public BitStackParams? CascadingParameters { get; set; }
+
+
+
///
/// Defines whether to render Stack children both horizontally and vertically.
///
@@ -161,6 +175,16 @@ protected override void RegisterCssStyles()
StyleBuilder.Register(() => (FitSize || FitHeight) ? "height:fit-content" : string.Empty);
}
+ [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(BitStackParams))]
+ protected override void OnParametersSet()
+ {
+ CascadingParameters?.UpdateParameters(this);
+
+ base.OnParametersSet();
+ }
+
+
+
protected override void BuildRenderTree(RenderTreeBuilder builder)
{
builder.OpenElement(0, Element ?? "div");
diff --git a/src/BlazorUI/Bit.BlazorUI/Components/Layouts/Stack/BitStackParams.cs b/src/BlazorUI/Bit.BlazorUI/Components/Layouts/Stack/BitStackParams.cs
new file mode 100644
index 0000000000..de3d5c88fc
--- /dev/null
+++ b/src/BlazorUI/Bit.BlazorUI/Components/Layouts/Stack/BitStackParams.cs
@@ -0,0 +1,248 @@
+namespace Bit.BlazorUI;
+
+///
+/// The parameters for component.
+///
+public class BitStackParams : BitComponentBaseParams, IBitComponentParams
+{
+ ///
+ /// Represents the parameter name used to identify the cascading parameters within .
+ ///
+ ///
+ /// This constant is typically used when referencing or accessing the BitStack value in
+ /// parameterized APIs or configuration settings. Using this constant helps ensure consistency and reduces the risk
+ /// of typographical errors.
+ ///
+ public const string ParamName = $"{nameof(BitParams)}.{nameof(BitStack)}";
+
+
+
+ public string Name => ParamName;
+
+
+
+ ///
+ /// Defines whether to render Stack children both horizontally and vertically.
+ ///
+ public BitAlignment? Alignment { get; set; }
+
+ ///
+ /// Make the height of the stack auto.
+ ///
+ public bool? AutoHeight { get; set; }
+
+ ///
+ /// Make the width and height of the stack auto.
+ ///
+ public bool? AutoSize { get; set; }
+
+ ///
+ /// Make the width of the stack auto.
+ ///
+ public bool? AutoWidth { get; set; }
+
+ ///
+ /// The custom html element used for the root node. The default is "div".
+ ///
+ public string? Element { get; set; }
+
+ ///
+ /// Expand the direct children to occupy all of the root element's width and height.
+ ///
+ public bool? FillContent { get; set; }
+
+ ///
+ /// Sets the height of the stack to fit its content.
+ ///
+ public bool? FitHeight { get; set; }
+
+ ///
+ /// Sets the width and height of the stack to fit its content.
+ ///
+ public bool? FitSize { get; set; }
+
+ ///
+ /// Sets the width of the stack to fit its content.
+ ///
+ public bool? FitWidth { get; set; }
+
+ ///
+ /// Defines the spacing between Stack children.
+ ///
+ public string? Gap { get; set; }
+
+ ///
+ /// Defines how much to grow the Stack in proportion to its siblings.
+ ///
+ public string? Grow { get; set; }
+
+ ///
+ /// Defines how much to grow the Stack in proportion to its siblings.
+ ///
+ public bool? Grows { get; set; }
+
+ ///
+ /// Defines whether to render Stack children horizontally.
+ ///
+ public bool? Horizontal { get; set; }
+
+ ///
+ /// Defines whether to render Stack children horizontally.
+ ///
+ public BitAlignment? HorizontalAlign { get; set; }
+
+ ///
+ /// Defines whether to render Stack children in the opposite direction (bottom-to-top if it's a vertical Stack and right-to-left if it's a horizontal Stack).
+ ///
+ public bool? Reversed { get; set; }
+
+ ///
+ /// Defines whether to render Stack children vertically.
+ ///
+ public BitAlignment? VerticalAlign { get; set; }
+
+ ///
+ /// Defines whether Stack children should wrap onto multiple rows or columns when they are about to overflow the size of the Stack.
+ ///
+ public bool? Wrap { get; set; }
+
+
+
+ ///
+ /// Updates the properties of the specified instance with any values that have been set on
+ /// this object, if those properties have not already been set on the .
+ ///
+ ///
+ /// Only properties that have a value set and have not already been set on the will be updated.
+ /// This method does not overwrite existing values on .
+ ///
+ ///
+ /// The instance whose properties will be updated. Cannot be null.
+ ///
+ public void UpdateParameters(BitStack bitStack)
+ {
+ if (bitStack is null) return;
+
+ UpdateBaseParameters(bitStack);
+
+ if (Alignment.HasValue && bitStack.HasNotBeenSet(nameof(Alignment)))
+ {
+ bitStack.Alignment = Alignment.Value;
+
+ bitStack.StyleBuilder.Reset();
+ }
+
+ if (AutoHeight.HasValue && bitStack.HasNotBeenSet(nameof(AutoHeight)))
+ {
+ bitStack.AutoHeight = AutoHeight.Value;
+
+ bitStack.StyleBuilder.Reset();
+ }
+
+ if (AutoSize.HasValue && bitStack.HasNotBeenSet(nameof(AutoSize)))
+ {
+ bitStack.AutoSize = AutoSize.Value;
+
+ bitStack.StyleBuilder.Reset();
+ }
+
+ if (AutoWidth.HasValue && bitStack.HasNotBeenSet(nameof(AutoWidth)))
+ {
+ bitStack.AutoWidth = AutoWidth.Value;
+
+ bitStack.StyleBuilder.Reset();
+ }
+
+ if (Element.HasValue() && bitStack.HasNotBeenSet(nameof(Element)))
+ {
+ bitStack.Element = Element;
+ }
+
+ if (FillContent.HasValue && bitStack.HasNotBeenSet(nameof(FillContent)))
+ {
+ bitStack.FillContent = FillContent.Value;
+
+ bitStack.ClassBuilder.Reset();
+ }
+
+ if (FitHeight.HasValue && bitStack.HasNotBeenSet(nameof(FitHeight)))
+ {
+ bitStack.FitHeight = FitHeight.Value;
+
+ bitStack.StyleBuilder.Reset();
+ }
+
+ if (FitSize.HasValue && bitStack.HasNotBeenSet(nameof(FitSize)))
+ {
+ bitStack.FitSize = FitSize.Value;
+
+ bitStack.StyleBuilder.Reset();
+ }
+
+ if (FitWidth.HasValue && bitStack.HasNotBeenSet(nameof(FitWidth)))
+ {
+ bitStack.FitWidth = FitWidth.Value;
+
+ bitStack.StyleBuilder.Reset();
+ }
+
+ if (Gap.HasValue() && bitStack.HasNotBeenSet(nameof(Gap)))
+ {
+ bitStack.Gap = Gap;
+
+ bitStack.StyleBuilder.Reset();
+ }
+
+ if (Grow.HasValue() && bitStack.HasNotBeenSet(nameof(Grow)))
+ {
+ bitStack.Grow = Grow;
+
+ bitStack.StyleBuilder.Reset();
+ }
+
+ if (Grows.HasValue && bitStack.HasNotBeenSet(nameof(Grows)))
+ {
+ bitStack.Grows = Grows.Value;
+
+ bitStack.StyleBuilder.Reset();
+ }
+
+ if (Horizontal.HasValue && bitStack.HasNotBeenSet(nameof(Horizontal)))
+ {
+ bitStack.Horizontal = Horizontal.Value;
+
+ bitStack.ClassBuilder.Reset();
+ bitStack.StyleBuilder.Reset();
+ }
+
+ if (HorizontalAlign.HasValue && bitStack.HasNotBeenSet(nameof(HorizontalAlign)))
+ {
+ bitStack.HorizontalAlign = HorizontalAlign.Value;
+
+ bitStack.StyleBuilder.Reset();
+ }
+
+ if (Reversed.HasValue && bitStack.HasNotBeenSet(nameof(Reversed)))
+ {
+ bitStack.Reversed = Reversed.Value;
+
+ bitStack.StyleBuilder.Reset();
+ }
+
+ if (VerticalAlign.HasValue && bitStack.HasNotBeenSet(nameof(VerticalAlign)))
+ {
+ bitStack.VerticalAlign = VerticalAlign.Value;
+
+ bitStack.StyleBuilder.Reset();
+ }
+
+ if (Wrap.HasValue && bitStack.HasNotBeenSet(nameof(Wrap)))
+ {
+ bitStack.Wrap = Wrap.Value;
+
+ bitStack.StyleBuilder.Reset();
+ }
+ }
+}
+
+