Separator
An enterprise-level separator component based on BrConfigProvider for global theme configuration. It supports horizontal/vertical display, style customization, and text slots.
Component Features
- 📏 Orientation: Supports both horizontal and vertical directions, automatically adapting to the container's width/height.
- 🎨 Style Customization: Provides multiple variants (
solid,dashed,dotted,double) and thicknesses (thin,medium,thick). - 🔤 Text Slots: Supports adding text or elements within the separator, automatically calculating background and spacing.
- 🧩 Component Integration: Seamlessly integrates with cards, forms, menus, and other components.
- 🌓 Theme Adaption: Automatically adapts to light/dark themes based on
BrConfigProvider, supporting global style overrides. - ♿ Accessibility: Provides semantic roles and supports
decorativeprop for screen readers.
Basic Usage
Basic horizontal and vertical separators.
Styles & Thickness
You can customize the separator's appearance using the thickness and variant props.
Card & Form Integration
Separators are often used to divide content within cards or group sections within forms.
With Text
You can use the default slot to add text or other elements to the center of the separator. The component will automatically manage the z-index and background color to ensure the text is readable.
Theme Customization
Combined with BrConfigProvider, the separator automatically adapts its color to the current theme based on the --border CSS variable.
API Reference
BrSeparator
SeparatorManager
A global singleton utility class used to manage z-index levels when multiple separators with text are nested or layered, preventing overlap conflicts.