Block types reference
Complete reference for all SuperDeck block types and their properties
Block types reference
SuperDeck has 3 core block types. Built-in widgets (image, dartpad, qrcode) use the same widget system as @widget.
align
Type: String | Default: center
Controls content alignment:
top_left,top_center,top_rightcenter_left,center,center_rightbottom_left,bottom_center,bottom_right
@column
Renders markdown content.
@column {
align: center
flex: 2
scrollable: true
}
# Your Content Here
- Lists
- Images
- Code blocks
- Tables
Use for text, code examples, lists, and tables.
@section
Arranges child blocks horizontally.
@section {
align: top_center
flex: 1
}
@column
Left content
@column
Right content
Properties:
blocks- Child blocks (auto-populated)
Use for multi-column layouts and side-by-side content.
Three-column example:
@section
@column
Column 1
@column
Column 2
@column
Column 3
@widget
Embeds custom Flutter widgets defined in your app.
@widget {
name: "customChart"
arg1: "value1"
arg2: 42
config: { nested: "object" }
}
Properties:
Custom arguments
Type: JSON-serializable values
All additional properties pass to the widget builder.
Setup in Flutter app:
import 'package:flutter/widgets.dart';
import 'package:superdeck/superdeck.dart';
class CustomChartDefinition extends WidgetDefinition<Map<String, Object?>> {
const CustomChartDefinition();
@override
Map<String, Object?> parse(Map<String, Object?> args) => args;
@override
Widget build(BuildContext context, Map<String, Object?> args) {
final title = args['title'] as String? ?? 'Untitled Chart';
final data = (args['data'] as List?)?.cast<Object?>() ?? const [];
return Text('$title (${data.length} points)');
}
}
SuperDeckApp(
options: DeckOptions(
widgets: const {
'customChart': CustomChartDefinition(),
},
),
);
Note: Use explicit (@widget { name: "chart" }) or shorthand (@chart) syntax. All properties pass to WidgetDefinition.parse() as Map<String, Object?>.
image
@image {
src: "path/to/image.png"
fit: cover
width: 400
height: 300
}
Properties:
src(required) - Asset path, absolute file path (/Users/...orfile:///...), or URLfit-fill,contain,cover,fitWidth,fitHeight,none,scaleDown(default:contain)width,height- Fixed dimensions in pixels
dartpad
@dartpad {
id: "d7b09149ffee07ec7c28"
theme: dark
run: true
}
Properties:
id(required) - DartPad ID from dartpad.devtheme-lightordark(default:light)embed- Embed mode (default:true)run- Auto-run code (default:true)
qrcode
Generates QR codes.
@qrcode {
text: "https://example.com"
size: 200
}
Properties:
text(required) - Text to encodesize- Size in logical pixels (default:200)errorCorrection-low,medium,high,highest(default:medium)backgroundColor,foregroundColor- Hex colors (for example,#ffffff)
Mermaid diagrams
Use a fenced code block with the mermaid language. The CLI renders Mermaid to PNG during superdeck build.
```mermaid
graph TD
A[Start] --> B[End]
```
Basic syntax
@blocktype {
property1: value1
property2: "string value"
property3: 42
property4: true
}
Property types
- String: Use quotes for string values:
"hello world" - Number: No quotes:
42,3.14 - Boolean:
trueorfalse - Object: Nested braces:
{ key: "value" } - Array: Square brackets:
["item1", "item2"]
Common patterns
Centered content:
@column {
align: center
}
Two-column layout:
@section
@column {
flex: 1
}
@column {
flex: 1
}
Hero image:
@image {
src: assets/hero.jpg
fit: cover
align: center
}
Interactive demo:
@dartpad {
id: "sample_id"
theme: "dark"
run: true
}
Custom widget:
@widget {
name: "twitterEmbed"
username: "flutter_dev"
tweetId: "1234567890"
}