The divider component creates visual separation between content sections in layouts. It provides a clean, semantic way to organize content with proper spacing and visual hierarchy. The component supports both horizontal and vertical orientations, customizable spacing, and works seamlessly with different themes.
✅ Use dividers when:
- Separating distinct content sections
- Creating visual hierarchy in lists or cards
- Organizing form sections or navigation items
- Providing breaks in dense content layouts
- Building responsive layouts that need flexible spacing
❌ Don't use dividers for:
- Purely decorative purposes without semantic meaning
- Heavy visual separation (use spacing or containers instead)
- Between every content item (can create visual clutter)
- Where whitespace alone would be sufficient
The default divider provides horizontal separation with standard spacing:
text 1
pure css 1
pure css 2Use vertical dividers to separate content in horizontal layouts such as navigation bars or inline elements:
Control the spacing around dividers using the design system's spacing scale. This affects the margin on both sides of the divider to create appropriate visual separation:
spacing="800"
pure css dds-divider--spacing-800
The divider component automatically adapts to different themes. Use the inverted variant for dark backgrounds:
spacing 400 inverted color
pure css spacing 400 inverted color
spacing 400import { DapDSDivider } from 'dap-design-system'
import { DapDSDividerReact } from 'dap-design-system/react'
For optimal bundle sizes, use the tree-shakeable import syntax:
import { DapDSDivider } from 'dap-design-system/components'
| Property | Type | Default | Description |
|---|---|---|---|
vertical | boolean | false | Whether the divider is vertical |
spacing | 0, 100 , 200 , 300 , 400 , 500 , 600 , 700 , 800 , 1000 , 1200 , 1400 , 1600 , 1800 , 2000 , 2400 , 3000 , 4000 , 5000 , 6000 | 0 | The spacing of the divider |
variant | 'normal', 'inverted' | 'normal' | The variant of the divider |
No slots available.
No custom events available.
No CSS parts available.
| Property Name | Description |
|---|---|
--dds-divider-border-width | The width of the divider border. (default: var(--dds-border-width-base)) |
--dds-divider-border-style | The style of the divider border. (default: solid) |
--dds-divider-border-color | The color of the divider border. (default: var(--dds-border-neutral-divider)) |
--dds-divider-border-color-inverted | The color of the divider border when inverted. (default: var(--dds-border-neutral-divider-inverted)) |
CSS custom properties (CSS variables) can be set directly on the component or in your stylesheet:
Method 1: Inline styles (Quick customization)
<dap-ds-divider
style="--dds-divider-border-width: value; --dds-divider-border-style: value;">
Divider
</dap-ds-divider>
Method 2: CSS classes (Reusable styles)
.my-custom-dap-ds-divider {
--dds-divider-border-width: value;
--dds-divider-border-style: value;
--dds-divider-border-color: value;
}
<dap-ds-divider class="my-custom-dap-ds-divider">
Divider
</dap-ds-divider>
Method 3: Global theme customization
/* Apply to all instances */
dap-ds-divider {
--dds-divider-border-width: value;
--dds-divider-border-style: value;
}
CSS custom properties inherit through the Shadow DOM, making them perfect for theming. Changes apply immediately without rebuilding.