Utilities
Separator
BitSeparator visually separates content into groups. The line runs across its container unless Vertical stands it up, and any content given to it - a label, an icon - sits between the two segments of the line, where AlignContent puts it. The line is drawn by the theme and restyled through LineStyle, Size, Thickness and Color, while Border keeps it on the neutral tiers and Inset holds it off the ends of its container. To assistive technologies it reports itself as a separator, named by its content, and a separator that is only visual sugar opts out of being announced through Decorative.
Usage
Every example is live. Open its code to see exactly what produced the component running underneath.
Basic
Vertical
AlignContent
ContentOffset
AutoSize
align-items wants. A vertical separator that gives up its stretch is then only
as tall as its own content, so an auto-sized one usually wants a container that stretches it.
Inset
Thickness
LineStyle
Decorative
separator role, so
a screen reader announces the boundary between groups. A page can also carry many rules that
mean nothing - each announced as "separator" is noise - and Decorative removes such a
separator from the accessibility tree while keeping its looks. The two below are visually
identical; only what a screen reader hears differs.
Color
Size
Style & Class
max-width with an auto
margin, for one, shortens the line the way a length prop would - and Styles and
Classes reach each part of the component by name: the Root and the
Content the label renders in. The line itself is the two pseudo elements of the root -
the segment before the content and the one after it - which the classed example below
restyles into one gradient running the length of the separator.
RTL
API
Every parameter, public member, sub-class and enum this component exposes.
BitSeparator parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| AlignContent | BitSeparatorAlignContent? | null | Where the content should be aligned in the separator. Defaults to the center of the line. |
| AutoSize | bool | false | Renders the separator with auto width or height, sizing it to its content instead of its container or the flex row it stands in. |
| Background | BitColorKind? | null | The color kind of the background of the patch the content of the separator sits on. Defaults to transparent. |
| Border | BitColorKind? | null | The color kind of the line of the separator, out of the neutral border tiers of the theme. |
| ChildContent | RenderFragment? | null | The content of the Separator, it can be any custom tag or text. It sits between the two segments of the line and also names the separator to assistive technologies, so nothing focusable belongs in it. |
| Classes | BitSeparatorClassStyles? | null | Custom CSS classes for different parts of the separator. |
| Color | BitColor? | null | The general color of the line of the separator, painting it in one of the roles of the theme. Wins over Border. |
| ContentOffset | string? | null | The offset of the content from the edge of the line it is aligned to, as any CSS length, where a percentage measures against the length of the separator. Only takes effect while AlignContent is Start or End. |
| Decorative | bool | false | Removes the separator from the accessibility tree, for a separator that is purely visual and should not be announced. |
| Inset | string? | null | Holds the separator off both ends of its container by this length, as any CSS length. |
| LineStyle | BitSeparatorLineStyle? | null | The style the line of the separator is drawn in: solid, dashed, dotted or double. |
| Size | BitSize? | null | The size of the line of the separator, out of the sizes of the theme. Thickness wins over it. |
| Styles | BitSeparatorClassStyles? | null | Custom CSS styles for different parts of the separator. |
| Thickness | string? | null | The thickness of the line of the separator, as any CSS length. Defaults to the weight of the current Size, which starts at the theme's divider hairline. |
| Vertical | bool | false | Whether the element is a vertical separator. A vertical separator stretches to the height of the flex row it stands in, and takes it from its container anywhere else. |
BitComponentBase parameters
| Name | Type | Default value | Description |
|---|---|---|---|
| AriaLabel | string? | null | Gets or sets the accessible label for the component, used by assistive technologies. |
| Class | string? | null | Gets or sets the CSS class name(s) to apply to the rendered element. |
| Dir | BitDir? | null | Gets or sets the text directionality for the component's content. |
| ForceAnimation | bool | false | Gets or sets a value indicating whether the component's animations play at their full duration even when reduced motion is requested. |
| HtmlAttributes | Dictionary<string, object> | new Dictionary<string, object>() | Captures additional HTML attributes to be applied to the rendered element, in addition to the component's parameters. |
| Id | string? | null | Gets or sets the unique identifier for the component's root element. |
| IsEnabled | bool | true | Gets or sets a value indicating whether the component is enabled and can respond to user interaction. |
| Style | string? | null | Gets or sets the CSS style string to apply to the rendered element. |
| TabIndex | string? | null | Gets or sets the tab order index for the component when navigating with the keyboard. |
| Visibility | BitVisibility | BitVisibility.Visible | Gets or sets the visibility state (visible, hidden, or collapsed) of the component. |
BitComponentBase public members
| Name | Type | Default value | Description |
|---|---|---|---|
| UniqueId | Guid | Guid.NewGuid() | Gets the readonly unique identifier for the component's root element, assigned when the component instance is constructed. |
| RootElement | ElementReference | Gets the reference to the root HTML element associated with this component. |
BitSeparatorClassStyles properties
| Name | Type | Default value | Description |
|---|---|---|---|
| Root | string? | null | Custom CSS classes/styles for the root element of the separator. |
| Content | string? | null | Custom CSS classes/styles for the element wrapping the ChildContent of the separator, which is only rendered while the separator has content. |
BitSeparatorAlignContent enum
| Name | Value | Description |
|---|---|---|
| Start | 0 | The content sits at the start of the line - the top of a vertical separator. |
| Center | 1 | The content sits at the middle of the line, which is the default. |
| End | 2 | The content sits at the end of the line - the bottom of a vertical separator. |
BitSeparatorLineStyle enum
| Name | Value | Description |
|---|---|---|
| Solid | 0 | A continuous line, which is the default. |
| Dashed | 1 | A line of short dashes. |
| Dotted | 2 | A line of dots. |
| Double | 3 | Two parallel lines with a gap between them, which needs a line of at least three pixels to have room to be drawn. |
BitSize enum
| Name | Value | Description |
|---|---|---|
| Small | 0 | The small size. |
| Medium | 1 | The medium size. |
| Large | 2 | The large size. |
BitColor enum
| Name | Value | Description |
|---|---|---|
| Primary | 0 | Primary general color. |
| Secondary | 1 | Secondary general color. |
| Tertiary | 2 | Tertiary general color. |
| Info | 3 | Info general color. |
| Success | 4 | Success general color. |
| Warning | 5 | Warning general color. |
| SevereWarning | 6 | SevereWarning general color. |
| Error | 7 | Error general color. |
| PrimaryBackground | 8 | Primary background color. |
| SecondaryBackground | 9 | Secondary background color. |
| TertiaryBackground | 10 | Tertiary background color. |
| PrimaryForeground | 11 | Primary foreground color. |
| SecondaryForeground | 12 | Secondary foreground color. |
| TertiaryForeground | 13 | Tertiary foreground color. |
| PrimaryBorder | 14 | Primary border color. |
| SecondaryBorder | 15 | Secondary border color. |
| TertiaryBorder | 16 | Tertiary border color. |
BitColorKind enum
| Name | Value | Description |
|---|---|---|
| Primary | 0 | The primary color kind. |
| Secondary | 1 | The secondary color kind. |
| Tertiary | 2 | The tertiary color kind. |
| Transparent | 3 | The transparent color kind. |
BitVisibility enum
| Name | Value | Description |
|---|---|---|
| Visible | 0 | The content of the component is visible. |
| Hidden | 1 | The content of the component is hidden, but the space it takes on the page remains (visibility:hidden). |
| Collapsed | 2 | The component is hidden (display:none). |
BitDir enum
| Name | Value | Description |
|---|---|---|
| Ltr | 0 | Ltr (left to right) is to be used for languages that are written from the left to the right (like English). |
| Rtl | 1 | Rtl (right to left) is to be used for languages that are written from the right to the left (like Arabic). |
| Auto | 2 | Auto lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then applies that directionality to the whole element. |
Feedback
Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.