Class TwSeparator
- Namespace
- TwBlazor.Components
- Assembly
- TwBlazor.dll
Represents a horizontal or vertical line that divides content, optionally with a label such as "or" or a date in the line.
public class TwSeparator : TwBlazorComponentBase, IComponent, IHandleEvent, IHandleAfterRender, ITwComponent
- Inheritance
-
TwSeparator
- Implements
- Inherited Members
Remarks
By default the separator is exposed to assistive technology as a separator with its orientation, named by its Label. Set Decorative when the line is purely visual, so it is hidden from assistive technology.
Constructors
TwSeparator()
public TwSeparator()
Properties
ChildContent
Gets or sets custom content shown in the line instead of Label, such as an icon or a button.
[Parameter]
public RenderFragment? ChildContent { get; set; }
Property Value
Remarks
Assistive technology does not read the content of a separator, so set AriaLabel to name a separator with custom content, unless it is Decorative.
Color
Gets or sets the color of the line and label. If not set, the separator uses the theme's neutral border color.
[Parameter]
public Color? Color { get; set; }
Property Value
Decorative
Gets or sets whether the separator is purely visual. Defaults to false.
[Parameter]
public bool Decorative { get; set; }
Property Value
Remarks
A decorative separator has role="none" and, with no label, is hidden with aria-hidden; a label
is then read as plain text. Otherwise the separator has role="separator" and aria-orientation,
so screen readers announce the break between the content on either side.
Label
Gets or sets the text shown in the line, such as "or continue with". It also names the separator for assistive technology.
[Parameter]
public string? Label { get; set; }
Property Value
LabelAlign
Gets or sets where the label sits along the line. Defaults to Center.
[Parameter]
public SeparatorLabelAlign LabelAlign { get; set; }
Property Value
Remarks
Start and end follow the reading direction, so a start-aligned label sits on the right in a right to left layout.
Orientation
Gets or sets whether the separator runs across (a row) or down (a column). Defaults to Horizontal.
[Parameter]
public SeparatorOrientation Orientation { get; set; }
Property Value
Remarks
A vertical separator stretches to the height of its parent row, for example between the items of a flex toolbar.
Thickness
Gets or sets how thick the line is. Defaults to Thin.
[Parameter]
public SeparatorThickness Thickness { get; set; }
Property Value
Variant
Gets or sets the line style. Defaults to Solid.
[Parameter]
public SeparatorVariant Variant { get; set; }
Property Value
Methods
BuildRenderTree(RenderTreeBuilder)
Renders the component to the supplied RenderTreeBuilder.
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builderRenderTreeBuilder