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/Divider/Divider.razor.cs

54 lines
1.6 KiB

using Connected.Annotations;
using Connected.Extensions;
using Connected.Utilities;
using Microsoft.AspNetCore.Components;
namespace Connected.Components;
public partial class Divider : UIComponent
{
protected string Classname =>
new CssBuilder("mud-divider")
.AddClass($"mud-divider-absolute", Absolute)
.AddClass($"mud-divider-flexitem", FlexItem)
.AddClass($"mud-divider-light", Light)
.AddClass($"mud-divider-vertical", Vertical)
.AddClass($"mud-divider-{DividerType.ToDescriptionString()}", when: () => DividerType != DividerType.FullWidth)
.AddClass(Class)
.Build();
/// <summary>
/// Sets absolute position to the component.
/// </summary>
[Parameter]
[Category(CategoryTypes.Divider.Appearance)]
public bool Absolute { get; set; }
/// <summary>
/// If true, a vertical divider will have the correct height when used in flex container.
/// </summary>
[Parameter]
[Category(CategoryTypes.Divider.Appearance)]
public bool FlexItem { get; set; }
/// <summary>
/// If true, the divider will have a lighter color.
/// </summary>
[Parameter]
[Category(CategoryTypes.Divider.Appearance)]
public bool Light { get; set; }
/// <summary>
/// If true, the divider is displayed vertically.
/// </summary>
[Parameter]
[Category(CategoryTypes.Divider.Appearance)]
public bool Vertical { get; set; }
/// <summary>
/// The Divider type to use.
/// </summary>
[Parameter]
[Category(CategoryTypes.Divider.Appearance)]
public DividerType DividerType { get; set; } = DividerType.FullWidth;
}