Skip to main content

Module widgets

Module widgets 

Source
Expand description

Feature-gated widget modules (includes primitives for backward compatibility).

Modules§

file_system_treefile-system-tree
File system tree widget for ratatui.
hotkey_footerhotkey-footer
Hotkey footer widget for ratatui.
markdown_previewmarkdown-preview
Markdown rendering widget for ratatui applications.
theme_pickertheme-picker
Theme picker widget for ratatui.

Structs§

Attrs
CacheState
Cache state for markdown rendering.
Cell
Represents a single terminal cell.
CodeBlockColors
Colors for a code block theme
CollapseState
Collapse state for markdown sections.
ColorMapping
Color mapping for light/dark modes.
ColorPalette
Color palette for mapping named colors to RGB values.
CustomScrollbar
Custom scrollbar widget for markdown navigation.
Dialog
DialogState
DialogWidget
DisplaySettings
Display settings for markdown rendering.
DoubleClickState
State for tracking double-click detection with deferred single-click handling.
ExpandableEntry
State for a single expandable content entry. State for a single expandable content entry.
ExpandableState
Expandable state for markdown content.
FileSystemEntry
FileSystemTree
FileSystemTreeConfig
FileSystemTreeNode
FileSystemTreeState
GitStats
Git statistics for display in statusline.
GitStatsState
Git stats state for markdown source files.
Grid
HotkeyFooter
HotkeyItem
Margin
MarkdownDoubleClickEvent
Event returned when a line is double-clicked in the markdown widget.
MarkdownElement
A single markdown element that can be rendered to ratatui.
MarkdownState
Unified state for the markdown widget.
MarkdownStyle
Configuration for markdown rendering styles.
MarkdownThememarkdown-preview
Constructor functions for MarkdownTheme. Methods for MarkdownTheme. Markdown theme configuration struct.
MarkdownWidget
A scrollable, interactive markdown widget.
MenuBar
MenuItem
NodeState
State information for rendering a node.
Pane
A styled panel component with title, icon, padding, and optional footer
PaneInfo
Information about a pane for external access.
PaneLayout
A computed rectangle for a pane.
ParsedCache
Cache for parsed markdown (doesn’t depend on width).
Parser
A parser for terminal output which produces an in-memory representation of the terminal contents.
Pos
Rect
RenderCache
Cache for rendered markdown lines (depends on width).
RenderOptions
Render options for markdown elements
ResizableGrid
A grid-based layout for arranging multiple resizable panes.
ResizableGridWidget
A widget that wraps ResizableGrid with mouse interaction support.
ResizableGridWidgetState
State for ResizableGridWidget interactions.
Screen
Represents the overall terminal state.
ScreenDiffer
ScrollState
Scroll state for markdown rendering.
ScrollbarConfig
Configuration for scrollbar appearance.
SelectionPos
Position in the rendered text (visual coordinates). Position in the rendered text (visual coordinates).
SelectionState
Selection state for markdown widget.
Size
SourceState
Source state for markdown content management.
SplitAreas
Panel areas returned from split calculation.
SplitDividerLayout
Metadata describing a split divider within a layout.
StatusLineStacked
Statusline with stacked indicators on the left and right side.
StyledStatusLine
Builder for creating a styled statusline that looks like rat-salsa’s menu_status2.
SyntaxHighlighter
Syntax highlighting for code blocks using syntect.
ThemeColors
ThemePicker
ThemePickerState
ThemePickerStateSnapshot
Toast
A single toast notification
ToastManager
Manages multiple toast notifications
Toc
Table of Contents widget for markdown navigation.
TocConfig
Configuration for TOC appearance.
TocEntry
Table of Contents entry. A single entry in the Table of Contents.
TocState
State for the Table of Contents sidebar.
TreeKeyBindings
Configurable keybindings for tree navigation
TreeNavigator
Tree navigator with configurable keybindings.
TreeNode
A node in the tree.
TreeView
Tree view widget.
TreeViewRef
Tree view widget that borrows nodes instead of owning them.
TreeViewState
Tree view state for StatefulWidget pattern.
VimState
Vim keybinding state.

Enums§

BorderType
CheckboxState
Element enums and segment types. Checkbox state for task lists. Checkbox state for task lists.
CodeBlockBorderKind
Kind of code block border.
CodeBlockTheme
Code block color theme
Color
Represents a foreground or background color for cells.
ColumnAlignment
Column alignment for table cells. Represents the alignment of a table column.
CursorStyle
DialogType
ElementKind
Represents the kind of markdown element.
MarkdownEvent
Events emitted by the markdown widget. Events that can be emitted by the markdown widget.
MarkdownSource
Represents the source of markdown content.
MarkdownWidgetMode
Mode enum for the markdown widget statusline. Mode for the markdown widget statusline.
MouseProtocolMode
The xterm mouse handling mode currently in use.
OperationalMode
Operational mode for styled statusline
SplitAxis
Axis for splitting panes.
SyntaxThemeVariant
Theme variant for syntax highlighting. Theme variant for syntax highlighting.
TableBorderKind
Kind of table border.
TextSegment
Text segment types for markdown styling.
ThemePickerEvent
ThemeVariant
Theme variant selection enum.
ToastLevel
Toast notification level
VtEvent
WidgetEvent
Common events emitted by interactive widgets.

Constants§

BLOCKQUOTE_MARKER
Blockquote marker (matching render-markdown.nvim).
BUILTIN_THEMES
BULLET_MARKERS
Bullet markers that cycle by nesting level (matching render-markdown.nvim).
CHECKBOX_CHECKED
CHECKBOX_TODO
CHECKBOX_UNCHECKED
Checkbox icons (matching render-markdown.nvim).
DEFAULT_TOAST_DURATION
Default toast display duration (3 seconds).
HEADING_ICONS
Heading icons by level (matching render-markdown.nvim).
HORIZONTAL_RULE_CHAR
Horizontal rule character.
SLANT_BL_TR
PowerLine block cut at the diagonal (bottom-left to top-right). Requires a Nerd Font or PowerLine font.
SLANT_TL_BR
PowerLine block cut at the diagonal (top-left to bottom-right). Requires a Nerd Font or PowerLine font.

Traits§

BufferView

Functions§

display_width
get_effective_theme_variant
Function to resolve the effective theme variant. Get the effective color scheme based on variant and terminal detection.
get_visible_paths
Gets all visible paths (flattened tree with expansion state).
get_visible_paths_filtered
Returns visible paths filtered by a matcher function.
handle_click
Handle click event at the given position.
handle_mouse_event
Handle mouse event for the markdown widget.
handle_mouse_event_with_double_click
Handle mouse event with double-click detection.
load_theme_from_json
Function to load a markdown theme from JSON. Load a markdown theme from JSON string.
matches_filter
Checks if a node name matches the filter (case-insensitive contains).
render_element
Render a markdown element to ratatui Line with given width.
render_element_with_options
Render a markdown element with options.
render_markdown
Render markdown string to ratatui Text with default styling
render_markdown_to_elements
Render markdown content to markdown elements.
render_markdown_with_style
Render markdown string to ratatui Text with custom style configuration
render_screen
render_toasts
should_render_line
Check if a line should be rendered based on collapse state. Check if a markdown element should be rendered based on collapse state.
write_screen_diff

Type Aliases§

NodeFilterFn
Type alias for node filter function.
NodeRenderFn
Type alias for node render function to reduce complexity.
NodeRenderRefFn
Type alias for node render function that borrows data (for TreeViewRef).
PaneId
Identifier for panes managed by a SplitLayout or ResizableGrid.