examples/

directory
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2026 License: MIT

README

Examples

Naming convention

Examples use a range-based numbering prefix by category:

Range Category Description
0xx Core elements Basic herald rendering features
1xx Customization Themes, palettes, options
2xx Ecosystem / Pairing Integration with other libraries (separate modules, cd first)

When adding a new example, pick the next available number in the matching range.

Running

Some examples live in the root module and can be run directly with go run. Others are separate modules (they have their own go.mod) and need cd first.

Core elements (0xx)
Example Description Run
000_default-theme All elements with the default Rose Pine theme go run ./examples/000_default-theme/
001_lists Flat, nested, mixed, and hierarchical lists go run ./examples/001_lists/
002_alerts GitHub-style alert callouts (Note, Tip, Important, Warning, Caution) go run ./examples/002_alerts/
003_table Table rendering: bordered, minimal, alignment, striped rows, captions, and footer go run ./examples/003_table/
004_semantic-badges Semantic badges and tags with default and custom palettes go run ./examples/004_semantic-badges/
005_compose Compose multiple rendered blocks into a single output go run ./examples/005_compose/
006_section Section groups heading + content tightly; BR for line breaks go run ./examples/006_section/
Customization (1xx)
Example Description Run
100_custom-options Override styles, decoration chars, and tokens via functional options go run ./examples/100_custom-options/
101_custom-palette Custom adaptive theme from 9 colors using ColorPalette and LightDark go run ./examples/101_custom-palette/
102_builtin-themes Built-in themes (Dracula, Catppuccin, Base16, Charm) matching huh go run ./examples/102_builtin-themes/
103_catppuccin-theme Build a full theme from the Catppuccin palette cd examples/103_catppuccin-theme && go run .
Ecosystem / Pairing (2xx)
Example Description Run
200_chroma-syntax-highlighting Plug in chroma for syntax-highlighted code blocks cd examples/200_chroma-syntax-highlighting && go run .
201_tree-sitter-syntax-highlighting Plug in tree-sitter for AST-based syntax highlighting cd examples/201_tree-sitter-syntax-highlighting && go run .
202_gotreesitter-syntax-highlighting Pure-Go tree-sitter highlighting via gotreesitter cd examples/202_gotreesitter-syntax-highlighting && go run .
203_huh-form Using herald with huh for interactive TUI forms cd examples/203_huh-form && go run .
204_huh-wizard Multi-step project scaffolder with herald + huh cd examples/204_huh-wizard && go run .
205_bubbletea-release-viewer Scrollable release notes viewer with bubbletea viewport cd examples/205_bubbletea-release-viewer && go run .
206_bubbletea-explorer Sidebar + scrollable content pane explorer with bubbletea cd examples/206_bubbletea-explorer && go run .
207_tview-explorer Sidebar + scrollable content pane explorer with tview cd examples/207_tview-explorer && go run .
208_figure-with-image Figure with ASCII art image rendering via image2ascii cd examples/208_figure-with-image && go run .

Directories

Path Synopsis
herald with the default Rose Pine theme.
herald with the default Rose Pine theme.
Demonstrates flat lists, nested lists, mixed nesting, and hierarchical numbering.
Demonstrates flat lists, nested lists, mixed nesting, and hierarchical numbering.
GitHub-style alerts demo with the default Rose Pine theme.
GitHub-style alerts demo with the default Rose Pine theme.
Table rendering: bordered (default), minimal, custom padding, custom styles, column alignment, row separators, striped rows, captions, footer rows, and auto-truncation.
Table rendering: bordered (default), minimal, custom padding, custom styles, column alignment, row separators, striped rows, captions, footer rows, and auto-truncation.
Semantic badges and tags demo with the default Rose Pine theme.
Semantic badges and tags demo with the default Rose Pine theme.
Compose multiple rendered blocks into a single output.
Compose multiple rendered blocks into a single output.
Section groups a heading with its content so Compose does not insert an extra blank line between them.
Section groups a heading with its content so Compose does not insert an extra blank line between them.
Customizing herald with functional options: override individual styles, decoration characters, and tokens without replacing the entire theme.
Customizing herald with functional options: override individual styles, decoration characters, and tokens without replacing the entire theme.
Using ColorPalette with adaptive light/dark colors to create a custom theme.
Using ColorPalette with adaptive light/dark colors to create a custom theme.
Using herald's built-in named themes that match huh's color palettes.
Using herald's built-in named themes that match huh's color palettes.
demos
alerts command
GitHub-style alerts: Note, Tip, Important, Warning, Caution.
GitHub-style alerts: Note, Tip, Important, Warning, Caution.
blocks command
Block-level elements: paragraph, blockquote, code block, HR, and definition list.
Block-level elements: paragraph, blockquote, code block, HR, and definition list.
builtin-themes/base16 command
Base16 theme showcase.
Base16 theme showcase.
builtin-themes/catppuccin command
Catppuccin theme showcase.
Catppuccin theme showcase.
builtin-themes/charm command
Charm theme showcase.
Charm theme showcase.
builtin-themes/dracula command
Dracula theme showcase.
Dracula theme showcase.
headings command
All six heading levels with the default Rose Pine theme.
All six heading levels with the default Rose Pine theme.
hero command
Compact highlight reel for the README hero image.
Compact highlight reel for the README hero image.
inline command
Inline styles, links, and abbreviations.
Inline styles, links, and abbreviations.
lists command
Flat and nested lists with mixed nesting.
Flat and nested lists with mixed nesting.
tables command
Table elements: bordered, minimal, alignment, striped rows, caption, footer, and auto-truncation.
Table elements: bordered, minimal, alignment, striped rows, caption, footer, and auto-truncation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL