You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Connected.Components/Components/Grid/Grid.razor

34 lines
887 B

@namespace Connected.Components
@using Connected.Annotations;
@using Connected.Utilities
@using Connected.Extensions
@inherits UIComponent
<CascadingValue Value="this" IsFixed="true">
<div @attributes="UserAttributes" class="@Classname" style="@Style">
@ChildContent
</div>
</CascadingValue>
@code {
protected string Classname =>
new CssBuilder("grid")
.AddClass($"grid-spacing-xs-{Spacing.ToString()}")
.AddClass($"justify-{Justify.ToDescriptionString()}")
.AddClass(Class)
.Build();
[Parameter]
[Category(CategoryTypes.Grid.Behavior)]
public int Spacing { set; get; } = 3;
[Parameter]
[Category(CategoryTypes.Grid.Behavior)]
public Justify Justify { get; set; } = Justify.FlexStart;
[Parameter]
[Category(CategoryTypes.Grid.Behavior)]
public RenderFragment ChildContent { get; set; }
}