Widget Defaults Reference
This file is generated from widget source initializers (Default impls and new constructors). It is intended as an agent-facing quick reference for avoiding noisy builder chains.
Agent rule: omit setters whose value equals the default shown here. Do not emit
.width(Length::Auto),.border(true),.focusable(true), or similar calls unless the surrounding code needs to make that default explicit for readability.
Regenerate with python3 scripts/generate-widget-defaults.py --write. Check freshness with python3 scripts/generate-widget-defaults.py --check.
Button
Source: src/widgets/button/mod.rs:90 (Button).
| Field | Default initializer |
|---|---|
label | constructor/local value (not a default) |
icon | None |
icon_style | Style::default() |
icon_gap | 1 |
shortcut | None |
shortcut_style | Style::default() |
shortcut_gap | 1 |
style | Style::default() |
hover_style | StyleSlot::Inherit |
focus_style | StyleSlot::Inherit |
align | Align::Center |
width | Length::Auto |
height | Length::Auto |
variant | ButtonVariant::Bracket |
border_style | BorderStyle::Plain |
hover_border_style | None |
focus_border_style | None |
padding | Padding { left: 1, right: 1, top: 0, bottom: 0, } |
disabled | false |
disabled_style | Style::default() |
on_click | None |
on_key | None |
focusable | true |
Input
Source: src/widgets/input/mod.rs:83 (Input).
| Field | Default initializer |
|---|---|
value | constructor/local value (not a default) |
cursor | constructor/local value (not a default) |
anchor | None |
placeholder | None |
prefix | None |
suffix | None |
truncate_head | false |
style | Style::default() |
hover_style | StyleSlot::Inherit |
focus_style | StyleSlot::Inherit |
focus_content_style | Style::default() |
hover_border_style | None |
placeholder_style | Style::default() |
focus_placeholder_style | Style::default() |
prefix_style | Style::default() |
focus_prefix_style | Style::default() |
suffix_style | Style::default() |
focus_suffix_style | Style::default() |
caret_shape | CaretShape::default() |
caret_color | None |
selection_style | StyleSlot::Inherit |
border | true |
border_style | BorderStyle::Plain |
padding | Padding { left: 1, right: 1, top: 0, bottom: 0, } |
mask | None |
disabled | false |
disabled_style | Style::default() |
read_only | false |
error | None |
error_style | Style::default() |
reserve_error_row | false |
width | Length::Flex(1) |
height | Length::Auto |
on_change | None |
on_edit | None |
on_click | None |
on_key | None |
key_interceptor | None |
focusable | true |
tab_order | true |
TextArea
Source: src/widgets/text_area/mod.rs:1182 (TextArea).
| Field | Default initializer |
|---|---|
value | constructor/local value (not a default) |
cursor | 0 |
anchor | None |
placeholder | None |
style | Style::default() |
hover_style | StyleSlot::Inherit |
focus_style | StyleSlot::Inherit |
focus_content_style | Style::default() |
hover_border_style | None |
caret_shape | CaretShape::default() |
caret_color | None |
selection_style | StyleSlot::Inherit |
unfocused_selection_style | StyleSlot::Inherit |
show_selection_when_unfocused | true |
placeholder_style | Style::default() |
focus_placeholder_style | Style::default() |
line_numbers | false |
line_number_mode | TextAreaLineNumberMode::default() |
line_number_style | Style::default() |
min_line_number_width | 0 |
wrap | true |
color_strategy | None |
language | None |
theme | None |
border | true |
border_style | BorderStyle::Plain |
padding | Padding::default() |
width | Length::Flex(1) |
height | Length::Flex(1) |
scroll_offset | None |
scroll_to_line | None |
scroll_behavior | ScrollBehavior::Instant |
scroll_wheel | true |
scroll_wheel_multiplier | None |
on_change | None |
on_edit | None |
on_editor_state_change | None |
on_scroll | None |
on_scroll_to | None |
on_click | None |
on_key | None |
key_interceptor | None |
clear_bindings | None |
vim_motions | false |
vim_keymap | None |
vim_config | TextAreaVimConfig::default() |
on_vim_mode_change | None |
on_image_paste | None |
on_text_paste | None |
images | Vec::new() |
on_images_change | None |
image_mode | TextAreaImageMode::default() |
image_placeholder | "[Image]".into() |
image_placeholder_style | Style::default() |
image_placeholder_focus_style | Style::default() |
image_placeholder_hover_style | Style::default() |
disabled | false |
disabled_style | Style::default() |
read_only | false |
focusable | true |
newline_binding | None |
tab_width | 0 |
insert_tab | false |
tab_stop | 8 |
scrollbar | true |
scrollbar_config | ScrollbarConfig::default() |
h_scrollbar | false |
h_scrollbar_variant | ScrollbarVariant::default() |
h_scrollbar_thumb | None |
pin_scrollbar_focus_style | false |
gutter_lines | None |
gutter_col_width | 0 |
gutter_gap | 0 |
gutter | None |
peer_source_lines | None |
split_wrap_sync | None |
split_wrap_side | None |
split_wrap_padding_gutter_style | None |
split_wrap_padding_style | None |
copy_excluded_bytes | None |
clipboard_transform | None |
selection_excluded_lines | None |
multi_click_select | true |
triple_click_mode | crate::widgets::TripleClickSelectionMode::Line |
sentinels | Vec::new() |
on_sentinels_change | None |
on_sentinel_event | None |
on_sentinel_click | None |
decorations | Vec::new() |
virtual_texts | Vec::new() |
List
Source: src/widgets/list/mod.rs:1192 (List).
| Field | Default initializer |
|---|---|
items | Arc::new([]) |
selected | 0 |
scroll_keys | ScrollKeymap::default() |
scroll_wheel | true |
style | Style::default() |
hover_style | StyleSlot::Inherit |
item_hover_style | StyleSlot::Inherit |
active_style | StyleSlot::Inherit |
selection_style | StyleSlot::Inherit |
unfocused_selection_style | StyleSlot::Inherit |
active_symbol | None |
active_symbol_position | ListSymbolPosition::Left |
active_symbol_style | None |
selection_symbol | None |
selection_symbol_style | None |
unfocused_selection_symbol_style | None |
unselected_symbol | None |
symbol_column | true |
gutter_gap | 0 |
gutter_for_non_selectable | false |
selection_full_width | false |
item_horizontal_padding | Padding::default() |
header_horizontal_padding | Padding::default() |
border | false |
border_style | BorderStyle::Plain |
title | None |
title_style | Style::default() |
padding | Padding::default() |
scrollbar | false |
scrollbar_config | ScrollbarConfig::default() |
width | Length::Flex(1) |
height | Length::Flex(1) |
on_select | None |
on_item_click | None |
on_activate | None |
on_click | None |
activate_on_click | true |
on_scroll_to | None |
on_key | None |
disabled | false |
disabled_style | Style::default() |
focusable | true |
show_scroll_indicators | false |
scroll_indicator_style | Style::default() |
empty_text | None |
empty_text_style | Style::default() |
force_scroll_to_selected | false |
ListConfig
Source: src/widgets/list/mod.rs:66 (ListConfig).
| Field | Default initializer |
|---|---|
border | true |
border_style | BorderStyle::Plain |
padding | Padding::default() |
style | Style::default() |
selection_style | StyleSlot::Inherit |
unfocused_selection_style | StyleSlot::Inherit |
selection_full_width | false |
selection_symbol | None |
selection_symbol_style | None |
unfocused_selection_symbol_style | None |
symbol_column | true |
gutter_gap | 0 |
gutter_for_non_selectable | false |
scrollbar | false |
scrollbar_config | ScrollbarConfig::default() |
ScrollView
Source: src/widgets/scroll_view/mod.rs:687 (ScrollView).
| Field | Default initializer |
|---|---|
props | StackProps::default() |
offset | None |
scroll_request | None |
scroll_target | None |
scroll_behavior | ScrollBehavior::default() |
scroll_keys | ScrollKeymap::default() |
scroll_wheel | true |
scroll_wheel_multiplier | None |
scroll_wheel_behavior | ScrollWheelBehavior::default() |
ambient_page_scroll | false |
focusable | false |
on_scroll | None |
on_scroll_to | None |
on_viewport_change | None |
scrollbar | false |
scrollbar_config | ScrollbarConfig::default() |
show_scroll_indicators | false |
scroll_indicator_style | Style::default() |
clip_mode | ScrollClip::default() |
estimated_child_height | 3 |
scroll_state_key | None |
children | Vec::new() |
VStack/HStack shared StackProps
Source: src/widgets/containers/mod.rs:193 (StackProps).
Note: Applies to the shared props backing stack container defaults.
| Field | Default initializer |
|---|---|
gap | 0 |
padding | Padding::default() |
style | Style::default() |
align | Align::Start |
justify | Justify::Start |
width | Length::Flex(1) |
height | Length::Flex(1) |
focus_policy | FocusPolicy::None |
border | false |
border_style | BorderStyle::Plain |
even_flex | false |
Frame/FrameNode
Source: src/widgets/frame/node.rs:299 (FrameNode).
Note: Frame is the public builder; these defaults come from its FrameNode backing type.
| Field | Default initializer |
|---|---|
title | None |
title_prefix | None |
title_suffix | None |
title_alignment | Align::Start |
tab_titles | Vec::new() |
active_tab | 0 |
active_tab_style | Style::default() |
inactive_tab_style | Style::default() |
tab_variant | TabVariant::default() |
on_tab_change | None |
status | None |
status_center | None |
status_right | None |
padding | Padding::default() |
decorations | Vec::new() |
border | true |
border_style | BorderStyle::Plain |
border_edges | BorderEdges::All |
border_merge_mode | BorderMergeMode::Exact |
join_frame | false |
style | Style::default() |
title_style | Style::default() |
status_style | Style::default() |
width | Length::Flex(1) |
height | Length::Flex(1) |
unfocused_height | None |
focus_min_height | None |
compact | false |
collapsible | true |
header_padding | Padding::default() |
footer_padding | Padding::default() |
has_header | false |
focusable | false |
child_align | Align::Start |
style_overrides | None |
ProgressBar
Source: src/widgets/progress/mod.rs:239 (ProgressBar).
| Field | Default initializer |
|---|---|
progress | constructor/local value (not a default) |
progress_style | ProgressStyle::Block |
show_percentage | false |
percentage_position | ProgressTextPosition::Right |
label | None |
label_position | ProgressTextPosition::Right |
filled_style | Style::default() |
filled_gradient | None |
empty_style | Style::default() |
label_style | Style::default() |
style | Style::default() |
padding | Padding::default() |
width | Length::Flex(1) |
height | Length::Auto |
draggable | false |
step | None |
inverted | false |
on_change | None |
on_click | None |
focusable | false |
focus_style | StyleSlot::Inherit |
hover_style | StyleSlot::Inherit |
target | None |
target_style | Style::default() |
target_symbol | '◆' |
zones | Vec::new() |
block_empty_bg_dim | 0.85 |
Spinner
Source: src/widgets/spinner/mod.rs:154 (Spinner).
| Field | Default initializer |
|---|---|
spinner_style | SpinnerStyle::Dots |
speed | SpinnerSpeed::Normal |
frame | None |
label | None |
gap | 1 |
style | Style::default() |
label_style | Style::default() |
width | Length::Auto |
height | Length::Auto |
Select
Source: src/widgets/select/mod.rs:53 (Select).
| Field | Default initializer |
|---|---|
options | Vec::new() |
selected | None |
placeholder | "Select...".into() |
expanded | false |
on_toggle | None |
on_select | None |
on_change | None |
width | Length::Auto |
disabled | false |
button_variant | ButtonVariant::Outlined |
button_style | Style::default() |
button_hover_style | StyleSlot::Inherit |
button_focus_style | StyleSlot::Inherit |
button_disabled_style | Style::default() |
button_border_style | BorderStyle::Plain |
button_hover_border_style | None |
button_focus_border_style | None |
button_open_suffix | None |
button_closed_suffix | None |
button_suffix_style | Style::default() |
list_title | None |
list_title_style | Style::default() |
list_config | ListConfig { border: true, border_style: BorderStyle::Plain, padding: Padding::default(), style: Style::default(), selection_style: StyleSlot::Inherit, unfocused_selection_style: StyleSlot::Inherit, selection_full_width: false, selection_symbol: Some("> ".into()), selection_symbol_style: None, unfocused_selection_symbol_style: None, symbol_column: true, gutter_gap: 0, gutter_for_non_selectable: false, scrollbar: false, scrollbar_config: ScrollbarConfig::default(), } |
list_hover_style | None |
list_width | None |
list_height | Length::Px(6) |
match_button_width | false |
list_empty_text | None |
list_empty_text_style | Style::default() |
list_disabled_style | Style::default() |
ComboBox
Source: src/widgets/combo_box.rs:68 (ComboBox).
| Field | Default initializer |
|---|---|
items | Vec::new() |
query | Arc::from("") |
placeholder | Some("Type to filter...".into()) |
open | false |
active_index | None |
selected | None |
allow_custom_value | false |
width | Length::Flex(1) |
list_width | None |
list_height | Length::Px(8) |
match_input_width | false |
disabled | false |
placement | PopoverPlacement::BelowStart |
offset | PopoverOffset::ZERO |
clamp | true |
auto_flip | true |
input_style | Style::default() |
input_hover_style | StyleSlot::Inherit |
input_focus_style | StyleSlot::Inherit |
input_focus_content_style | Style::default() |
input_disabled_style | Style::default() |
input_hover_border_style | None |
input_placeholder_style | Style::default() |
input_focus_placeholder_style | Style::default() |
input_suffix_open | " ▲".into() |
input_suffix_closed | " ▼".into() |
input_suffix_style | Style::default() |
input_focus_suffix_style | Style::default() |
list_config | ListConfig { border: true, border_style: BorderStyle::Plain, padding: Padding::default(), style: Style::default(), selection_style: StyleSlot::Inherit, unfocused_selection_style: StyleSlot::Inherit, selection_full_width: false, selection_symbol: None, selection_symbol_style: None, unfocused_selection_symbol_style: None, symbol_column: true, gutter_gap: 0, gutter_for_non_selectable: false, scrollbar: false, scrollbar_config: ScrollbarConfig::default(), } |
list_hover_style | None |
empty_text | Some("No matches".into()) |
empty_text_style | Style::default() |
on_query_change | None |
on_open_change | None |
on_active_index_change | None |
on_commit | None |
MultiSelect
Source: src/widgets/multi_select.rs:140 (MultiSelect).
| Field | Default initializer |
|---|---|
items | Vec::new() |
active_index | 0 |
selected_indices | Vec::new() |
max_selected | None |
title | None |
title_style | Style::default() |
width | Length::Flex(1) |
height | Length::Flex(1) |
list_config | ListConfig { border: true, border_style: BorderStyle::Plain, padding: Padding::default(), style: Style::default(), selection_style: StyleSlot::Inherit, unfocused_selection_style: StyleSlot::Inherit, selection_full_width: false, selection_symbol: Some("[ ] ".into()), selection_symbol_style: None, unfocused_selection_symbol_style: None, symbol_column: true, gutter_gap: 0, gutter_for_non_selectable: false, scrollbar: false, scrollbar_config: ScrollbarConfig::default(), } |
item_hover_style | None |
active_symbol | Some("[x] ".into()) |
active_symbol_style | None |
active_style | StyleSlot::Inherit |
unselected_symbol | Some("[ ] ".into()) |
description_style | Style::default() |
description_placement | MultiSelectDescriptionPlacement::Inline |
description_overflow | MultiSelectDescriptionOverflow::Truncate |
description_selection | true |
disabled | false |
disabled_style | Style::default() |
empty_text | None |
empty_text_style | Style::default() |
on_active_index_change | None |
on_toggle | None |
on_change | None |
on_commit | None |
Modal
Source: src/widgets/modal.rs:33 (Modal).
| Field | Default initializer |
|---|---|
title | None |
child | Spacer::new().into() |
on_close | None |
scope | OverlayScope::RootPortal |
width | Length::Px(60) |
height | Length::Auto |
backdrop_style | Style::default() |
frame_style | Style::default() |
border | true |
border_style | BorderStyle::Plain |
padding | 1.into() |
title_style | Style::default() |
title_alignment | Align::Start |
PanView
Source: src/widgets/pan_view/mod.rs:235 (PanView).
| Field | Default initializer |
|---|---|
width | Length::Flex(1) |
height | Length::Flex(1) |
offset | None |
on_pan | None |
clamp | true |
center_content | false |
free_pan_margin | None |
drag_to_pan | true |
keymap | PanKeymap::default() |
key_step | (4, 2) |
focusable | true |
pan_state_key | None |
child | None |
Tabs
Source: src/widgets/tabs/mod.rs:104 (Tabs).
| Field | Default initializer |
|---|---|
tabs | Arc::new([]) |
active | 0 |
style | Style::default() |
focus_style | StyleSlot::Inherit |
hover_style | StyleSlot::Inherit |
tab_hover_style | StyleSlot::Inherit |
active_style | StyleSlot::Inherit |
divider | '│' |
overflow | TabsOverflow::Clip |
border | false |
border_style | BorderStyle::Plain |
padding | Padding::default() |
width | Length::Flex(1) |
height | Length::Auto |
on_change | None |
on_click | None |
on_key | None |
disabled | false |
disabled_style | Style::default() |
focusable | true |
DraggableTabBar
Source: src/widgets/draggable_tab_bar/mod.rs:456 (DraggableTabBar).
| Field | Default initializer |
|---|---|
tabs | Arc::new([]) |
active | 0 |
style | Style::default() |
focus_style | StyleSlot::Inherit |
hover_style | StyleSlot::Inherit |
tab_hover_style | StyleSlot::Inherit |
active_style | StyleSlot::Inherit |
close_style | Style::default() |
close_hover_style | Style::default() |
divider | '│' |
border | false |
border_style | BorderStyle::Plain |
padding | Padding::default() |
width | Length::Flex(1) |
height | Length::Auto |
variant | DraggableTabBarVariant::Bordered |
accent_symbol | '▏' |
active_accent_symbol | '▎' |
accent_style | Style::default() |
active_accent_style | Style::default() |
close_symbol | Arc::from("") |
show_close_buttons | true |
close_on_hover_only | false |
tab_max_width | None |
overflow | DraggableTabBarOverflow::Scroll |
scroll_wheel | true |
show_overflow_controls | true |
overflow_style | Style::default() |
overflow_hover_style | Style::default() |
scroll_offset | 0 |
show_file_icons | false |
file_icon_style | FileIconStyle::NerdFont |
file_icon_palette | FileIconPalette::default() |
file_icon_overrides | HashMap::new() |
bar_id | None |
drag_group | None |
draggable | true |
drag_preview | true |
reorder_mode | DragReorderMode::Live |
drag_threshold | 1 |
on_change | None |
on_action | None |
on_close | None |
on_reorder | None |
on_transfer | None |
on_click | None |
on_key | None |
disabled | false |
disabled_style | Style::default() |
focusable | true |
DocumentView
Source: src/widgets/document_view/mod.rs:316 (DocumentView).
| Field | Default initializer |
|---|---|
value | "".into() |
layout_content_fingerprint | Cell::new(None) |
content_type | None |
formatter | None |
width | Length::Flex(1) |
height | Length::Flex(1) |
wrap | true |
line_numbers | false |
min_line_number_width | 0 |
line_number_separator | true |
line_number_content_gap | 0 |
line_number_mode | DocumentLineNumberMode::default() |
line_number_style | Style::default() |
highlight_full_width | false |
border | true |
border_style | BorderStyle::Plain |
padding | Padding::default() |
table_wrap | false |
table_width_mode | DocumentTableWidthMode::default() |
table_outer_frame | true |
table_column_separators | true |
table_row_separators | TableRowSeparators::default() |
table_cell_padding | 0 |
table_border_variant | BorderStyle::Plain |
style | Style::default() |
hover_style | StyleSlot::Inherit |
focus_style | StyleSlot::Inherit |
focus_content_style | Style::default() |
selection_style | StyleSlot::Inherit |
doc_styles | DocumentStyles::default() |
hover_border_style | None |
scroll_offset | None |
scroll_to_source_line | None |
scroll_behavior | ScrollBehavior::default() |
scrollbar | true |
scrollbar_config | ScrollbarConfig::default() |
h_scrollbar | false |
h_scrollbar_variant | ScrollbarVariant::default() |
h_scrollbar_thumb | None |
pin_scrollbar_focus_style | false |
scroll_wheel | true |
scroll_wheel_multiplier | None |
focusable | true |
on_scroll | None |
on_click | None |
on_select | None |
on_key | None |
shared_selection_id | None |
code_syntax_strategy | None |
gutter_lines | None |
gutter_col_width | 0 |
gutter_gap | 0 |
copy_excluded_source_lines | None |
peer_source_lines | None |
peer_source_fingerprint | Cell::new(None) |
measure_base_key_cache | Cell::new(None) |
split_wrap_sync | None |
split_wrap_side | None |
diff_split_pane | None |
split_wrap_padding_gutter_style | None |
split_wrap_padding_style | None |
multi_click_select | true |
triple_click_mode | crate::widgets::TripleClickSelectionMode::Line |
passthrough_clicks | false |
measure_cache | RefCell::new([None, None]) |
measure_format_cache | RefCell::new(None) |
DiffView
Source: src/widgets/diff_view/mod.rs:255 (DiffView).
Note: DiffView::new() delegates to new_internal("", "", None); argument-backed content fields are shown as constructor/local values.
| Field | Default initializer |
|---|---|
before | constructor/local value (not a default) |
after | constructor/local value (not a default) |
patch | None |
mode | DiffViewMode::Split |
backend | DiffViewBackend::TextArea |
backend_explicit | false |
width_override | None |
height_override | None |
editable | false |
wrap_override | None |
line_numbers_override | None |
min_line_number_width_override | None |
gutter_inset_override | None |
scrollbar_override | None |
h_scrollbar_override | None |
focusable_override | None |
outer_border | false |
pane_border | true |
highlight_full_width | false |
single_scrollbar | false |
join_frame | false |
vertical_separator | false |
vertical_separator_char | '│' |
vertical_separator_style | Style::default() |
scroll_offset | None |
scroll_to_hunk | None |
on_scroll | None |
on_context_separator_click | None |
context_separator_hover_style | None |
text_area | constructor/local value (not a default) |
document_view | constructor/local value (not a default) |
diff_style | DiffPalette::default() |
prefixes | DiffPrefixes::default() |
show_prefixes | true |
word_diff | true |
trim_common_indent | true |
shared_selection_id | None |
language | None |
theme | None |
base_color_strategy | None |
diff_data | constructor/local value (not a default) |
context_lines | None |
show_context_separator | true |
context_separator_text | default_context_separator_text() |
context_separator_min_lines | 2 |
context_expand_lines | 20 |
expanded_contexts | Vec::new() |
pane_cache | RefCell::new(Vec::new()) |
ManagedTerminal
Source: src/widgets/managed_terminal.rs:89 (ManagedTerminalProps).
Note: ManagedTerminal is a component; defaults come from ManagedTerminalProps.
| Field | Default initializer |
|---|---|
config | TerminalPtyConfig::default() |
scrollback | 2000 |
initial_cols | 120 |
initial_rows | 24 |
on_status | None |
auto_start | true |
placeholder | Some(Arc::from("Starting terminal...")) |
forward_mouse | true |
scroll_wheel | true |
style | crate::style::Style::default() |
focusable | true |
width | Length::Flex(1) |
height | Length::Flex(1) |
CommandPalette
Source: src/widgets/command_palette.rs:325 (CommandPalette).
| Field | Default initializer |
|---|---|
props | CommandPaletteProps { on_close: None, show_disabled: false, width: Length::Px(80), height: Length::Px(20), backdrop_style: Style::default(), frame_style: Style::default(), border: true, border_style: BorderStyle::Plain, padding: 0.into(), title: None, title_style: Style::default(), title_alignment: Align::Start, scope: OverlayScope::RootPortal, } |
ContextMenu
Source: src/widgets/context_menu.rs:42 (ContextMenu).
| Field | Default initializer |
|---|---|
trigger | constructor/local value (not a default) |
items | Vec::new() |
open | false |
on_select | None |
on_close | None |
placement | PopoverPlacement::BelowStart |
offset | PopoverOffset::ZERO |
clamp | true |
auto_flip | true |
anchor | None |
width | Length::Px(20) |
height | Length::Auto |
border | true |
border_style | BorderStyle::Plain |
padding | Padding::default() |
style | Style::default() |
selection_style | StyleSlot::Inherit |
unfocused_selection_style | StyleSlot::Inherit |
item_hover_style | None |
selection_symbol | Some("> ".into()) |
selection_symbol_style | None |
unfocused_selection_symbol_style | None |
scrollbar | false |
scrollbar_config | ScrollbarConfig::default() |