Skip to main content
twblazor
Home
  • Get started
  • Tailwind with Blazor
  • Why twblazor?
  • Theme
  • Class Merge
    • Configuring localization
    • RTL Provider
  • Breadcrumb
  • Card
  • Carousel
  • Collapse
  • Context Menu
  • Drawer
  • Footer
  • Menu
  • Navbar
  • On This Page
  • Separator
  • Sidebar
  • Stepper
  • Tabs
  • Tree List
  • Container
  • Flex
  • Grid
  • Text
  • Link
  • Button
  • Form
    • AutocompleteNew
    • Checkbox
    • Color Picker
    • Date Picker
    • Date Range Picker
    • Datetime Picker
    • Datetime Range Picker
    • File Upload
    • Input GroupNew
    • NumericNew
    • Masked InputNew
    • Radio Button
    • Range SliderNew
    • RatingNew
    • Select
    • Slider
    • Switch
    • Tag InputNew
    • Text EditorNew
    • Textfield
    • Time Picker
    • Time Range Picker
  • Toggle
  • Toggle Group
  • Alert
  • Avatar
  • Badge
  • Chip
  • Empty
  • Icon
  • Popover
  • Progress
  • Skeleton
  • Spinner
  • Tooltip
  • Data Table
  • SpreadsheetNew
  • Column Filter Editor
  • Pagination
  • Pick List
  • Barcode
  • QR Code
  • Calendar
  • Table
  • Attachment
  • Overview
    • Bar
    • Bullet
    • Column
    • Dot Plot
    • Dumbbell
    • Icon
    • Lollipop
    • Radial Bar
    • Range
    • Word Cloud
    • Area
    • Bump
    • Bump Area
    • Candlestick
    • Gantt
    • Horizon
    • Line
    • Slope
    • Small Multiples
    • Stream Graph
    • Funnel
    • Gauge
    • Marimekko
    • Nightingale
    • Pie
    • Treemap
    • Waffle
    • Waterfall
    • Circular Treemap
    • Convex Treemap
    • Dendrogram
    • Sunburst
    • Barcode
    • Beeswarm
    • Box Plot
    • Density Plot
    • Histogram
    • Radial Histogram
    • Ridgeline
    • Strip Plot
    • Violin Plot
    • Categorical Scatter
    • Contour
    • Hexagonal Binning
    • Quadrant
    • Scatter
    • Heatmap
    • Matrix
    • Parallel Coordinates
    • Radar
    • Arc Diagram
    • Chord Diagram
    • Flowchart
    • Network Diagram
    • Sankey
    • Euler Diagram
    • Venn Diagram
  • Bubble
  • Marker
  • Message
  • Dialog Service
  • Toast Service
API DocumentationAI Agents & Skills
Home Get Started

Layout

TwSeparator

TwSeparator is a Blazor horizontal or vertical divider, with an optional label, line style, thickness and color.

Last updated 9 November 2026

Horizontal

By default TwSeparator is a full width line between blocks of content. Add margin with Class, for example Class="my-4".

twblazor

A Tailwind CSS component library for Blazor.

Free and open source under the MIT License.

RAZOR
<div>
    <p class="text-sm font-medium text-gray-900 dark:text-white">twblazor</p>
    <p class="text-sm text-gray-600 dark:text-gray-300">A Tailwind CSS component library for Blazor.</p>
    <TwSeparator Class="my-4" />
    <p class="text-sm text-gray-600 dark:text-gray-300">Free and open source under the MIT License.</p>
</div>

Vertical

Set Orientation to SeparatorOrientation.Vertical for a line between items in a row, such as links or toolbar groups. It stretches to the height of the row.
Blog
Docs
Source
RAZOR
<div class="flex h-5 items-center gap-4 text-sm text-gray-900 dark:text-white">
    <span>Blog</span>
    <TwSeparator Orientation="SeparatorOrientation.Vertical" />
    <span>Docs</span>
    <TwSeparator Orientation="SeparatorOrientation.Vertical" />
    <span>Source</span>
</div>

With a label

Set Label to show text in the line, such as "or continue with" between ways to sign in. The label also names the separator for screen readers.
or continue with
RAZOR
<div class="mx-auto flex w-full max-w-sm flex-col gap-4">
    <TwButton Label="Sign in with email" Color="Color.Primary" Class="w-full" />
    <TwSeparator Label="or continue with" />
    <div class="grid grid-cols-2 gap-3">
        <TwButton Label="GitHub" StartIcon="Icon.Github" Variant="ButtonVariant.Outlined" Class="w-full" />
        <TwButton Label="Google" StartIcon="Icon.Google" Variant="ButtonVariant.Outlined" Class="w-full" />
    </div>
</div>

Label alignment

Set LabelAlign to put the label at the Start, Center or End of the line. Start and end follow the reading direction, so they swap sides in a right to left layout.
Start
Center
End
RAZOR
<div class="flex flex-col gap-4">
    <TwSeparator Label="Start" LabelAlign="SeparatorLabelAlign.Start" />
    <TwSeparator Label="Center" />
    <TwSeparator Label="End" LabelAlign="SeparatorLabelAlign.End" />
</div>

Custom content

Put any content, such as an icon, between the tags instead of a Label. Screen readers do not read the content of a separator, so name it with AriaLabel.
Today Â· 3 unread
RAZOR
<div class="flex flex-col gap-4">
    <TwSeparator AriaLabel="End of section">
        <TwIcon Icon="Icon.Stars" />
    </TwSeparator>
    <TwSeparator AriaLabel="Today, 3 unread">
        <strong>Today</strong>&nbsp;· 3 unread
    </TwSeparator>
</div>

Vertical with a label

A vertical separator can have a label too. The lines run above and below it.
Sign in
or
Create an account
RAZOR
<div class="flex h-32 items-stretch gap-4 text-sm text-gray-600 dark:text-gray-300">
    <div class="flex flex-1 items-center justify-center">Sign in</div>
    <TwSeparator Orientation="SeparatorOrientation.Vertical" Label="or" />
    <div class="flex flex-1 items-center justify-center">Create an account</div>
</div>

Line style and thickness

Set Variant to Solid, Dashed or Dotted, and Thickness to Thin, Medium or Thick.
Solid
Dashed
Dotted
Medium
Thick dashed
RAZOR
<div class="flex flex-col gap-6">
    <TwSeparator Label="Solid" />
    <TwSeparator Label="Dashed" Variant="SeparatorVariant.Dashed" />
    <TwSeparator Label="Dotted" Variant="SeparatorVariant.Dotted" />
    <TwSeparator Label="Medium" Thickness="SeparatorThickness.Medium" />
    <TwSeparator Label="Thick dashed" Thickness="SeparatorThickness.Thick" Variant="SeparatorVariant.Dashed" />
</div>

Colors

Separators are neutral by default. Set Color to color the line and its label, for example a danger colored "New messages" divider.
Primary
Success
New messages
RAZOR
<div class="flex flex-col gap-4">
    <TwSeparator Label="Primary" Color="Color.Primary" />
    <TwSeparator Label="Success" Color="Color.Success" />
    <TwSeparator Label="New messages" Color="Color.Danger" Thickness="SeparatorThickness.Medium" />
    <TwSeparator Color="Color.Info" Variant="SeparatorVariant.Dashed" />
</div>

In a card

Separate groups of settings or fields inside a TwCard. A line that only decorates, where the groups need no announced break, can be Decorative.

Notifications

Choose how and when we get in touch.

RAZOR
<TwCard Title="Notifications">
    <HeaderContent>
        <p class="text-sm text-gray-600 dark:text-gray-300">Choose how and when we get in touch.</p>
    </HeaderContent>
    <ChildContent>
        <div class="flex flex-col gap-4 text-sm">
            <div class="grid gap-4 sm:grid-cols-2">
                <TwSwitch Label="Email" @bind-Value="email" />
                <TwSwitch Label="Push notifications" @bind-Value="push" />
            </div>
            <TwSeparator Decorative />
            <div class="grid gap-4 sm:grid-cols-2">
                <TwSwitch Label="Weekly summary" @bind-Value="summary" />
                <TwSwitch Label="Product news" @bind-Value="news" />
            </div>
        </div>
    </ChildContent>
    <FooterContent>
        <div class="ms-auto flex flex-wrap gap-2">
            <TwButton Variant="ButtonVariant.Text" Color="Color.Primary">Cancel</TwButton>
            <TwButton Variant="ButtonVariant.Filled" Color="Color.Primary">Save changes</TwButton>
        </div>
    </FooterContent>
</TwCard>

Decorative separators

A separator is announced as a break between content, with its orientation. Set Decorative when the line only decorates. It then has role="none", and without a label it is hidden from screen readers. A decorative label is read as plain text.
Announced as a separator
Read as plain text
RAZOR
<div class="flex flex-col gap-4">
    <TwSeparator Label="Announced as a separator" />
    <TwSeparator Label="Read as plain text" Decorative />
    <TwSeparator Decorative />
</div>

Accessibility

A separator has role="separator" and aria-orientation, and is named by its Label. Name a separator with custom content with AriaLabel, or point AriaLabelledBy at a heading. A separator is not focusable, so the keyboard passes over it. The line is drawn as a border, so it stays visible in forced colors (Windows high contrast) mode, and start and end follow the reading direction.

Keyboard navigation

This component is not interactive, so it has no keyboard controls of its own and is not a Tab stop. Anything interactive you place inside it keeps its own keyboard behaviour.

Theme configuration

Styling is controlled by TwBlazorTheme.Components (a TwSeparatorTheme), configured via the AddTwBlazor() options callback described on the Get Started page. Every property is a set of Tailwind classes, so changes are picked up by your own Tailwind build.
Property Type Controls
Base string
Horizontal string
Vertical string
LabeledHorizontal string
LabeledVertical string
HorizontalLine string
VerticalLine string
LabelLine string
LineStretch string
LineInset string
Label string
Thin string
Medium string
Thick string
Solid string
Dashed string
Dotted string
Neutral string

Global Theme Configuration

These reuse shared design tokens configured once on TwBlazorTheme, rather than being unique to this component.
Property Type Controls
Colors TwBlazorPalette

Full reference: TwSeparatorTheme on the API docs.

On this page

  • Horizontal
  • Vertical
  • With a label
  • Label alignment
  • Custom content
  • Vertical with a label
  • Line style and thickness
  • Colors
  • In a card
  • Decorative separators
  • Accessibility
  • Keyboard navigation
  • Theme configuration
twblazor

The Tailwind CSS component library for Blazor. Accessible, themeable and MIT licensed.

Discord (opens in a new tab) GitHub(opens in a new tab)

Get started

  • Install guide
  • Theming
  • Class merging
  • Localization

Guides

  • Tailwind CSS with Blazor
  • Why twblazor?
  • Right to left
  • AI agents and skills

Resources

  • API documentation (opens in a new tab)
  • llms.txt (opens in a new tab)
  • MIT License (opens in a new tab)

Community

  • Contributing (opens in a new tab)
  • Code of conduct (opens in a new tab)
  • Report an issue (opens in a new tab)

twblazor is and always will be free and open source.

An unhandled error has occurred. Reload