Skip to content

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).

FieldDefault initializer
labelconstructor/local value (not a default)
iconNone
icon_styleStyle::default()
icon_gap1
shortcutNone
shortcut_styleStyle::default()
shortcut_gap1
styleStyle::default()
hover_styleStyleSlot::Inherit
focus_styleStyleSlot::Inherit
alignAlign::Center
widthLength::Auto
heightLength::Auto
variantButtonVariant::Bracket
border_styleBorderStyle::Plain
hover_border_styleNone
focus_border_styleNone
paddingPadding { left: 1, right: 1, top: 0, bottom: 0, }
disabledfalse
disabled_styleStyle::default()
on_clickNone
on_keyNone
focusabletrue

Input

Source: src/widgets/input/mod.rs:83 (Input).

FieldDefault initializer
valueconstructor/local value (not a default)
cursorconstructor/local value (not a default)
anchorNone
placeholderNone
prefixNone
suffixNone
truncate_headfalse
styleStyle::default()
hover_styleStyleSlot::Inherit
focus_styleStyleSlot::Inherit
focus_content_styleStyle::default()
hover_border_styleNone
placeholder_styleStyle::default()
focus_placeholder_styleStyle::default()
prefix_styleStyle::default()
focus_prefix_styleStyle::default()
suffix_styleStyle::default()
focus_suffix_styleStyle::default()
caret_shapeCaretShape::default()
caret_colorNone
selection_styleStyleSlot::Inherit
bordertrue
border_styleBorderStyle::Plain
paddingPadding { left: 1, right: 1, top: 0, bottom: 0, }
maskNone
disabledfalse
disabled_styleStyle::default()
read_onlyfalse
errorNone
error_styleStyle::default()
reserve_error_rowfalse
widthLength::Flex(1)
heightLength::Auto
on_changeNone
on_editNone
on_clickNone
on_keyNone
key_interceptorNone
focusabletrue
tab_ordertrue

TextArea

Source: src/widgets/text_area/mod.rs:1182 (TextArea).

FieldDefault initializer
valueconstructor/local value (not a default)
cursor0
anchorNone
placeholderNone
styleStyle::default()
hover_styleStyleSlot::Inherit
focus_styleStyleSlot::Inherit
focus_content_styleStyle::default()
hover_border_styleNone
caret_shapeCaretShape::default()
caret_colorNone
selection_styleStyleSlot::Inherit
unfocused_selection_styleStyleSlot::Inherit
show_selection_when_unfocusedtrue
placeholder_styleStyle::default()
focus_placeholder_styleStyle::default()
line_numbersfalse
line_number_modeTextAreaLineNumberMode::default()
line_number_styleStyle::default()
min_line_number_width0
wraptrue
color_strategyNone
languageNone
themeNone
bordertrue
border_styleBorderStyle::Plain
paddingPadding::default()
widthLength::Flex(1)
heightLength::Flex(1)
scroll_offsetNone
scroll_to_lineNone
scroll_behaviorScrollBehavior::Instant
scroll_wheeltrue
scroll_wheel_multiplierNone
on_changeNone
on_editNone
on_editor_state_changeNone
on_scrollNone
on_scroll_toNone
on_clickNone
on_keyNone
key_interceptorNone
clear_bindingsNone
vim_motionsfalse
vim_keymapNone
vim_configTextAreaVimConfig::default()
on_vim_mode_changeNone
on_image_pasteNone
on_text_pasteNone
imagesVec::new()
on_images_changeNone
image_modeTextAreaImageMode::default()
image_placeholder"[Image]".into()
image_placeholder_styleStyle::default()
image_placeholder_focus_styleStyle::default()
image_placeholder_hover_styleStyle::default()
disabledfalse
disabled_styleStyle::default()
read_onlyfalse
focusabletrue
newline_bindingNone
tab_width0
insert_tabfalse
tab_stop8
scrollbartrue
scrollbar_configScrollbarConfig::default()
h_scrollbarfalse
h_scrollbar_variantScrollbarVariant::default()
h_scrollbar_thumbNone
pin_scrollbar_focus_stylefalse
gutter_linesNone
gutter_col_width0
gutter_gap0
gutterNone
peer_source_linesNone
split_wrap_syncNone
split_wrap_sideNone
split_wrap_padding_gutter_styleNone
split_wrap_padding_styleNone
copy_excluded_bytesNone
clipboard_transformNone
selection_excluded_linesNone
multi_click_selecttrue
triple_click_modecrate::widgets::TripleClickSelectionMode::Line
sentinelsVec::new()
on_sentinels_changeNone
on_sentinel_eventNone
on_sentinel_clickNone
decorationsVec::new()
virtual_textsVec::new()

List

Source: src/widgets/list/mod.rs:1192 (List).

FieldDefault initializer
itemsArc::new([])
selected0
scroll_keysScrollKeymap::default()
scroll_wheeltrue
styleStyle::default()
hover_styleStyleSlot::Inherit
item_hover_styleStyleSlot::Inherit
active_styleStyleSlot::Inherit
selection_styleStyleSlot::Inherit
unfocused_selection_styleStyleSlot::Inherit
active_symbolNone
active_symbol_positionListSymbolPosition::Left
active_symbol_styleNone
selection_symbolNone
selection_symbol_styleNone
unfocused_selection_symbol_styleNone
unselected_symbolNone
symbol_columntrue
gutter_gap0
gutter_for_non_selectablefalse
selection_full_widthfalse
item_horizontal_paddingPadding::default()
header_horizontal_paddingPadding::default()
borderfalse
border_styleBorderStyle::Plain
titleNone
title_styleStyle::default()
paddingPadding::default()
scrollbarfalse
scrollbar_configScrollbarConfig::default()
widthLength::Flex(1)
heightLength::Flex(1)
on_selectNone
on_item_clickNone
on_activateNone
on_clickNone
activate_on_clicktrue
on_scroll_toNone
on_keyNone
disabledfalse
disabled_styleStyle::default()
focusabletrue
show_scroll_indicatorsfalse
scroll_indicator_styleStyle::default()
empty_textNone
empty_text_styleStyle::default()
force_scroll_to_selectedfalse

ListConfig

Source: src/widgets/list/mod.rs:66 (ListConfig).

FieldDefault initializer
bordertrue
border_styleBorderStyle::Plain
paddingPadding::default()
styleStyle::default()
selection_styleStyleSlot::Inherit
unfocused_selection_styleStyleSlot::Inherit
selection_full_widthfalse
selection_symbolNone
selection_symbol_styleNone
unfocused_selection_symbol_styleNone
symbol_columntrue
gutter_gap0
gutter_for_non_selectablefalse
scrollbarfalse
scrollbar_configScrollbarConfig::default()

ScrollView

Source: src/widgets/scroll_view/mod.rs:687 (ScrollView).

FieldDefault initializer
propsStackProps::default()
offsetNone
scroll_requestNone
scroll_targetNone
scroll_behaviorScrollBehavior::default()
scroll_keysScrollKeymap::default()
scroll_wheeltrue
scroll_wheel_multiplierNone
scroll_wheel_behaviorScrollWheelBehavior::default()
ambient_page_scrollfalse
focusablefalse
on_scrollNone
on_scroll_toNone
on_viewport_changeNone
scrollbarfalse
scrollbar_configScrollbarConfig::default()
show_scroll_indicatorsfalse
scroll_indicator_styleStyle::default()
clip_modeScrollClip::default()
estimated_child_height3
scroll_state_keyNone
childrenVec::new()

VStack/HStack shared StackProps

Source: src/widgets/containers/mod.rs:193 (StackProps).

Note: Applies to the shared props backing stack container defaults.

FieldDefault initializer
gap0
paddingPadding::default()
styleStyle::default()
alignAlign::Start
justifyJustify::Start
widthLength::Flex(1)
heightLength::Flex(1)
focus_policyFocusPolicy::None
borderfalse
border_styleBorderStyle::Plain
even_flexfalse

Frame/FrameNode

Source: src/widgets/frame/node.rs:299 (FrameNode).

Note: Frame is the public builder; these defaults come from its FrameNode backing type.

FieldDefault initializer
titleNone
title_prefixNone
title_suffixNone
title_alignmentAlign::Start
tab_titlesVec::new()
active_tab0
active_tab_styleStyle::default()
inactive_tab_styleStyle::default()
tab_variantTabVariant::default()
on_tab_changeNone
statusNone
status_centerNone
status_rightNone
paddingPadding::default()
decorationsVec::new()
bordertrue
border_styleBorderStyle::Plain
border_edgesBorderEdges::All
border_merge_modeBorderMergeMode::Exact
join_framefalse
styleStyle::default()
title_styleStyle::default()
status_styleStyle::default()
widthLength::Flex(1)
heightLength::Flex(1)
unfocused_heightNone
focus_min_heightNone
compactfalse
collapsibletrue
header_paddingPadding::default()
footer_paddingPadding::default()
has_headerfalse
focusablefalse
child_alignAlign::Start
style_overridesNone

ProgressBar

Source: src/widgets/progress/mod.rs:239 (ProgressBar).

FieldDefault initializer
progressconstructor/local value (not a default)
progress_styleProgressStyle::Block
show_percentagefalse
percentage_positionProgressTextPosition::Right
labelNone
label_positionProgressTextPosition::Right
filled_styleStyle::default()
filled_gradientNone
empty_styleStyle::default()
label_styleStyle::default()
styleStyle::default()
paddingPadding::default()
widthLength::Flex(1)
heightLength::Auto
draggablefalse
stepNone
invertedfalse
on_changeNone
on_clickNone
focusablefalse
focus_styleStyleSlot::Inherit
hover_styleStyleSlot::Inherit
targetNone
target_styleStyle::default()
target_symbol'◆'
zonesVec::new()
block_empty_bg_dim0.85

Spinner

Source: src/widgets/spinner/mod.rs:154 (Spinner).

FieldDefault initializer
spinner_styleSpinnerStyle::Dots
speedSpinnerSpeed::Normal
frameNone
labelNone
gap1
styleStyle::default()
label_styleStyle::default()
widthLength::Auto
heightLength::Auto

Select

Source: src/widgets/select/mod.rs:53 (Select).

FieldDefault initializer
optionsVec::new()
selectedNone
placeholder"Select...".into()
expandedfalse
on_toggleNone
on_selectNone
on_changeNone
widthLength::Auto
disabledfalse
button_variantButtonVariant::Outlined
button_styleStyle::default()
button_hover_styleStyleSlot::Inherit
button_focus_styleStyleSlot::Inherit
button_disabled_styleStyle::default()
button_border_styleBorderStyle::Plain
button_hover_border_styleNone
button_focus_border_styleNone
button_open_suffixNone
button_closed_suffixNone
button_suffix_styleStyle::default()
list_titleNone
list_title_styleStyle::default()
list_configListConfig { 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_styleNone
list_widthNone
list_heightLength::Px(6)
match_button_widthfalse
list_empty_textNone
list_empty_text_styleStyle::default()
list_disabled_styleStyle::default()

ComboBox

Source: src/widgets/combo_box.rs:68 (ComboBox).

FieldDefault initializer
itemsVec::new()
queryArc::from("")
placeholderSome("Type to filter...".into())
openfalse
active_indexNone
selectedNone
allow_custom_valuefalse
widthLength::Flex(1)
list_widthNone
list_heightLength::Px(8)
match_input_widthfalse
disabledfalse
placementPopoverPlacement::BelowStart
offsetPopoverOffset::ZERO
clamptrue
auto_fliptrue
input_styleStyle::default()
input_hover_styleStyleSlot::Inherit
input_focus_styleStyleSlot::Inherit
input_focus_content_styleStyle::default()
input_disabled_styleStyle::default()
input_hover_border_styleNone
input_placeholder_styleStyle::default()
input_focus_placeholder_styleStyle::default()
input_suffix_open" ▲".into()
input_suffix_closed" ▼".into()
input_suffix_styleStyle::default()
input_focus_suffix_styleStyle::default()
list_configListConfig { 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_styleNone
empty_textSome("No matches".into())
empty_text_styleStyle::default()
on_query_changeNone
on_open_changeNone
on_active_index_changeNone
on_commitNone

MultiSelect

Source: src/widgets/multi_select.rs:140 (MultiSelect).

FieldDefault initializer
itemsVec::new()
active_index0
selected_indicesVec::new()
max_selectedNone
titleNone
title_styleStyle::default()
widthLength::Flex(1)
heightLength::Flex(1)
list_configListConfig { 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_styleNone
active_symbolSome("[x] ".into())
active_symbol_styleNone
active_styleStyleSlot::Inherit
unselected_symbolSome("[ ] ".into())
description_styleStyle::default()
description_placementMultiSelectDescriptionPlacement::Inline
description_overflowMultiSelectDescriptionOverflow::Truncate
description_selectiontrue
disabledfalse
disabled_styleStyle::default()
empty_textNone
empty_text_styleStyle::default()
on_active_index_changeNone
on_toggleNone
on_changeNone
on_commitNone

Source: src/widgets/modal.rs:33 (Modal).

FieldDefault initializer
titleNone
childSpacer::new().into()
on_closeNone
scopeOverlayScope::RootPortal
widthLength::Px(60)
heightLength::Auto
backdrop_styleStyle::default()
frame_styleStyle::default()
bordertrue
border_styleBorderStyle::Plain
padding1.into()
title_styleStyle::default()
title_alignmentAlign::Start

PanView

Source: src/widgets/pan_view/mod.rs:235 (PanView).

FieldDefault initializer
widthLength::Flex(1)
heightLength::Flex(1)
offsetNone
on_panNone
clamptrue
center_contentfalse
free_pan_marginNone
drag_to_pantrue
keymapPanKeymap::default()
key_step(4, 2)
focusabletrue
pan_state_keyNone
childNone

Tabs

Source: src/widgets/tabs/mod.rs:104 (Tabs).

FieldDefault initializer
tabsArc::new([])
active0
styleStyle::default()
focus_styleStyleSlot::Inherit
hover_styleStyleSlot::Inherit
tab_hover_styleStyleSlot::Inherit
active_styleStyleSlot::Inherit
divider'│'
overflowTabsOverflow::Clip
borderfalse
border_styleBorderStyle::Plain
paddingPadding::default()
widthLength::Flex(1)
heightLength::Auto
on_changeNone
on_clickNone
on_keyNone
disabledfalse
disabled_styleStyle::default()
focusabletrue

DraggableTabBar

Source: src/widgets/draggable_tab_bar/mod.rs:456 (DraggableTabBar).

FieldDefault initializer
tabsArc::new([])
active0
styleStyle::default()
focus_styleStyleSlot::Inherit
hover_styleStyleSlot::Inherit
tab_hover_styleStyleSlot::Inherit
active_styleStyleSlot::Inherit
close_styleStyle::default()
close_hover_styleStyle::default()
divider'│'
borderfalse
border_styleBorderStyle::Plain
paddingPadding::default()
widthLength::Flex(1)
heightLength::Auto
variantDraggableTabBarVariant::Bordered
accent_symbol'▏'
active_accent_symbol'▎'
accent_styleStyle::default()
active_accent_styleStyle::default()
close_symbolArc::from("")
show_close_buttonstrue
close_on_hover_onlyfalse
tab_max_widthNone
overflowDraggableTabBarOverflow::Scroll
scroll_wheeltrue
show_overflow_controlstrue
overflow_styleStyle::default()
overflow_hover_styleStyle::default()
scroll_offset0
show_file_iconsfalse
file_icon_styleFileIconStyle::NerdFont
file_icon_paletteFileIconPalette::default()
file_icon_overridesHashMap::new()
bar_idNone
drag_groupNone
draggabletrue
drag_previewtrue
reorder_modeDragReorderMode::Live
drag_threshold1
on_changeNone
on_actionNone
on_closeNone
on_reorderNone
on_transferNone
on_clickNone
on_keyNone
disabledfalse
disabled_styleStyle::default()
focusabletrue

DocumentView

Source: src/widgets/document_view/mod.rs:316 (DocumentView).

FieldDefault initializer
value"".into()
layout_content_fingerprintCell::new(None)
content_typeNone
formatterNone
widthLength::Flex(1)
heightLength::Flex(1)
wraptrue
line_numbersfalse
min_line_number_width0
line_number_separatortrue
line_number_content_gap0
line_number_modeDocumentLineNumberMode::default()
line_number_styleStyle::default()
highlight_full_widthfalse
bordertrue
border_styleBorderStyle::Plain
paddingPadding::default()
table_wrapfalse
table_width_modeDocumentTableWidthMode::default()
table_outer_frametrue
table_column_separatorstrue
table_row_separatorsTableRowSeparators::default()
table_cell_padding0
table_border_variantBorderStyle::Plain
styleStyle::default()
hover_styleStyleSlot::Inherit
focus_styleStyleSlot::Inherit
focus_content_styleStyle::default()
selection_styleStyleSlot::Inherit
doc_stylesDocumentStyles::default()
hover_border_styleNone
scroll_offsetNone
scroll_to_source_lineNone
scroll_behaviorScrollBehavior::default()
scrollbartrue
scrollbar_configScrollbarConfig::default()
h_scrollbarfalse
h_scrollbar_variantScrollbarVariant::default()
h_scrollbar_thumbNone
pin_scrollbar_focus_stylefalse
scroll_wheeltrue
scroll_wheel_multiplierNone
focusabletrue
on_scrollNone
on_clickNone
on_selectNone
on_keyNone
shared_selection_idNone
code_syntax_strategyNone
gutter_linesNone
gutter_col_width0
gutter_gap0
copy_excluded_source_linesNone
peer_source_linesNone
peer_source_fingerprintCell::new(None)
measure_base_key_cacheCell::new(None)
split_wrap_syncNone
split_wrap_sideNone
diff_split_paneNone
split_wrap_padding_gutter_styleNone
split_wrap_padding_styleNone
multi_click_selecttrue
triple_click_modecrate::widgets::TripleClickSelectionMode::Line
passthrough_clicksfalse
measure_cacheRefCell::new([None, None])
measure_format_cacheRefCell::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.

FieldDefault initializer
beforeconstructor/local value (not a default)
afterconstructor/local value (not a default)
patchNone
modeDiffViewMode::Split
backendDiffViewBackend::TextArea
backend_explicitfalse
width_overrideNone
height_overrideNone
editablefalse
wrap_overrideNone
line_numbers_overrideNone
min_line_number_width_overrideNone
gutter_inset_overrideNone
scrollbar_overrideNone
h_scrollbar_overrideNone
focusable_overrideNone
outer_borderfalse
pane_bordertrue
highlight_full_widthfalse
single_scrollbarfalse
join_framefalse
vertical_separatorfalse
vertical_separator_char'│'
vertical_separator_styleStyle::default()
scroll_offsetNone
scroll_to_hunkNone
on_scrollNone
on_context_separator_clickNone
context_separator_hover_styleNone
text_areaconstructor/local value (not a default)
document_viewconstructor/local value (not a default)
diff_styleDiffPalette::default()
prefixesDiffPrefixes::default()
show_prefixestrue
word_difftrue
trim_common_indenttrue
shared_selection_idNone
languageNone
themeNone
base_color_strategyNone
diff_dataconstructor/local value (not a default)
context_linesNone
show_context_separatortrue
context_separator_textdefault_context_separator_text()
context_separator_min_lines2
context_expand_lines20
expanded_contextsVec::new()
pane_cacheRefCell::new(Vec::new())

ManagedTerminal

Source: src/widgets/managed_terminal.rs:89 (ManagedTerminalProps).

Note: ManagedTerminal is a component; defaults come from ManagedTerminalProps.

FieldDefault initializer
configTerminalPtyConfig::default()
scrollback2000
initial_cols120
initial_rows24
on_statusNone
auto_starttrue
placeholderSome(Arc::from("Starting terminal..."))
forward_mousetrue
scroll_wheeltrue
stylecrate::style::Style::default()
focusabletrue
widthLength::Flex(1)
heightLength::Flex(1)

CommandPalette

Source: src/widgets/command_palette.rs:325 (CommandPalette).

FieldDefault initializer
propsCommandPaletteProps { 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).

FieldDefault initializer
triggerconstructor/local value (not a default)
itemsVec::new()
openfalse
on_selectNone
on_closeNone
placementPopoverPlacement::BelowStart
offsetPopoverOffset::ZERO
clamptrue
auto_fliptrue
anchorNone
widthLength::Px(20)
heightLength::Auto
bordertrue
border_styleBorderStyle::Plain
paddingPadding::default()
styleStyle::default()
selection_styleStyleSlot::Inherit
unfocused_selection_styleStyleSlot::Inherit
item_hover_styleNone
selection_symbolSome("> ".into())
selection_symbol_styleNone
unfocused_selection_symbol_styleNone
scrollbarfalse
scrollbar_configScrollbarConfig::default()

MIT OR Apache-2.0