Columns
Columns arrange 2 to 4 independent content slots side by side inside a single flow block — ideal for dashboards, feature comparisons, spec sheets, and structured notes. Each column owns its own child story and supports paragraphs, headings, lists, images, callouts, and charts.
- Included in:
notesConfiguration,documentConfiguration - Pure-Dart import:
package:vyuh_document_elements/columns.dartorpackage:vyuh_document_elements/vyuh_document_elements.dart - Flutter extension:
ColumnsDocumentExtension(bundled inDocumentEditorElements.defaults) - Action namespace:
ColumnsActions
Quick example
dart
import 'package:vyuh_document/vyuh_document.dart';
import 'package:vyuh_document_elements/vyuh_document_elements.dart';
final doc = Document.of(notesConfiguration, [
Columns(
columns: [
[Heading('Pros', level: HeadingLevel.h3), Paragraph('Pure Dart layout')],
[Heading('Cons', level: HeadingLevel.h3), Paragraph('None known')],
],
weights: const [0.6, 0.4],
gap: 20,
showDivider: true,
),
]);What you can configure
| Property | Type / Values | Purpose |
|---|---|---|
columns | List<List<DocumentBlock>> (2–4 slots) | Independent editable block stories rendered side by side |
weights | List<double> | Relative fractional width for each column (for example [0.5, 0.5], [0.33, 0.67], [0.25, 0.5, 0.25]) |
gap | double (points) | Horizontal gutter spacing between adjacent columns |
showDivider | bool | Renders a subtle vertical divider line centered in each gutter |
Actions & commands
| Action ID | Effect |
|---|---|
ColumnsActions.insertTwo | Insert a 2-column side-by-side block |
ColumnsActions.insertThree | Insert a 3-column side-by-side block |
ColumnsActions.count(int n) | Parameterized helper for 2- or 3-column insertion |
- Typed command:
SetColumnWeightsadjusts column proportions canonically (and the Properties panel provides equal, 2:1, 1:2, and custom weight presets plus gap and divider controls).
Restricting usage
- Remove multi-column blocks:
notesConfiguration.withoutElements([Columns.element]) - Allow 2 columns only: Include only
ColumnsActions.insertTwoin yourActionGroupand gateColumnsActions.insertThreeinDocumentPolicy.
Format parity
| DOCX | HTML | Markdown | |
|---|---|---|---|
| Borderless multi-column OOXML table with proportional widths | Side-by-side resolved geometry with exact weights & dividers | CSS Grid container (grid-template-columns) | Structured multi-column fallback preserving slot order |