Overview
Divider blocks create horizontal lines to visually separate sections of content. They are non-editable blocks that provide clear visual breaks in documents.Block Keys
/lib/src/editor/block_component/divider_block_component/divider_block_component.dart:5
Creating Divider Nodes
Use thedividerNode() helper function:
/lib/src/editor/block_component/divider_block_component/divider_block_component.dart:12
Component Builder
Create a divider component with custom styling:lineColor- Color of the divider line (default:Colors.grey)height- Total height of the divider block (default:10)wrapper- Optional widget wrapper for custom styling
/lib/src/editor/block_component/divider_block_component/divider_block_component.dart:24
Widget Structure
/lib/src/editor/block_component/divider_block_component/divider_block_component.dart:63
Rendering
The divider is rendered as a FlutterDivider widget:
- Height: 10px
- Line thickness: 1px
- Color: Grey
- Alignment: Center
/lib/src/editor/block_component/divider_block_component/divider_block_component.dart:100
Selection Behavior
Dividers support block selection:- Selected as blocks - Click to select entire divider
- Cursor positioned - Navigate to divider with arrow keys
- Multi-selected - Include in range selections
/lib/src/editor/block_component/divider_block_component/divider_block_component.dart:117
Cursor Style
Dividers use a special cursor style:/lib/src/editor/block_component/divider_block_component/divider_block_component.dart:159
Position Handling
Dividers have start and end positions:/lib/src/editor/block_component/divider_block_component/divider_block_component.dart:150
Validation
Dividers must not have children:/lib/src/editor/block_component/divider_block_component/divider_block_component.dart:60
Markdown Shortcuts
Create dividers using markdown syntax:Using in Editor
Add divider support to your editor:Inserting Dividers
Custom Divider Styles
Dashed Line
Gradient Divider
Decorative Divider
Thick Divider
Colored Section Divider
Slash Menu Integration
Add divider to slash menu:Navigation
Navigating to/from dividers:Deletion
Key Features
- Visual Separation - Clear content boundaries
- Non-Editable - No text content or children
- Selectable - Can be selected and deleted
- Keyboard Navigation - Arrow keys work properly
- Markdown Support -
---,***,___shortcuts - Customizable - Color, height, and wrapper styling
- Block Selection - Full selection support
Use Cases
- Section Breaks - Separate major sections
- Visual Rhythm - Break up long content
- Thematic Shifts - Mark topic changes
- Before/After - Separate contrasting content
- List Separation - Divide related list groups
Best Practices
- Use sparingly - Too many dividers create visual clutter
- Consistent styling - Maintain uniform appearance
- Semantic meaning - Use for meaningful breaks
- Adequate spacing - Add vertical padding for breathing room
- Alternative options - Consider headings or whitespace instead
Accessibility
- Dividers are keyboard navigable
- Screen readers can identify dividers as separators
- Selection and deletion work as expected
- Proper ARIA roles for semantic HTML
Related
Heading Blocks
Structure content with headings
Paragraph Blocks
Basic text blocks