Overview
Quote blocks are used to visually distinguish quoted text, citations, or emphasized content from regular paragraphs. They feature a distinctive vertical bar and optional custom styling.Block Keys
/lib/src/editor/block_component/quote_block_component/quote_block_component.dart:6
Creating Quote Nodes
Use thequoteNode() helper function:
/lib/src/editor/block_component/quote_block_component/quote_block_component.dart:18
Component Builder
Create a quote component with custom configuration:/lib/src/editor/block_component/quote_block_component/quote_block_component.dart:36
Default Quote Icon
The default quote indicator is a vertical bar:- Width: 4px
- Color:
#00BCF0(cyan/light blue) - Min width: 26px
- Min height: 22px
- Right padding: 4px
/lib/src/editor/block_component/quote_block_component/quote_block_component.dart:192
Widget Structure
/lib/src/editor/block_component/quote_block_component/quote_block_component.dart:69
Mixins Used
- Text selection and cursor handling
- Background color support
- Text direction (LTR/RTL)
- Text alignment
/lib/src/editor/block_component/quote_block_component/quote_block_component.dart:87
Layout Structure
Quotes use anIntrinsicHeight widget to stretch the vertical bar:
IntrinsicHeight ensures the vertical bar extends to match the text height, even for multi-line quotes.
Source: /lib/src/editor/block_component/quote_block_component/quote_block_component.dart:121
Markdown Shortcut
Create quotes using markdown syntax:> followed by a space to create a quote block.
Using in Editor
Add quote support to your editor:Inserting Quotes
Custom Quote Styles
Gradient Bar
Quote Mark Icon
Background Style
Author Attribution
Create quotes with attribution using nested nodes:Colored Quotes
Multi-line Quotes
Quotes automatically handle multi-line content:IntrinsicHeight widget ensures the vertical bar stretches to match the text height.
Key Features
- Visual Distinction - Vertical bar for clear identification
- Rich Text Support - Full Delta format with inline styling
- Custom Icons - Replaceable quote indicator
- Text Direction - LTR and RTL support
- Alignment - Left, center, right alignment
- Background Color - Custom background colors
- Markdown Shortcut -
>syntax support - Nested Content - Can contain child blocks
- Automatic Height - Bar scales with content
Use Cases
- Block Quotes - Citations from external sources
- Pull Quotes - Highlight key passages
- Testimonials - Customer or user feedback
- Warnings - Important notices (with custom styling)
- Tips - Helpful information (with custom styling)
- Code Comments - Explanatory notes about code
Best Practices
- Use sparingly - Too many quotes reduce impact
- Add attribution - Credit sources when quoting
- Keep concise - Long quotes are hard to scan
- Style consistently - Use similar styling throughout
- Consider semantics - Use appropriate semantic meaning
Accessibility
- Quote blocks are properly structured for screen readers
- Text direction is respected for RTL languages
- Selection and navigation work as expected
- Keyboard shortcuts follow standard conventions
Related
Paragraph Blocks
Basic text blocks
Heading Blocks
Document structure with headings