Open-Source Wikis

/

Bevy

/

Packages

/

bevy_ui_widgets

bevyengine/bevy

bevy_ui_widgets

Standard widget primitives — buttons, checkboxes, sliders, scrollbars, radios, text inputs. Lower-level than bevy_feathers: unstyled, just behavior. Pair with your own theme to get a consistent look.

Purpose

Two reasons to use this crate without bevy_feathers:

  1. You want widget behavior (mouse and keyboard handling, accessibility plumbing, disabled state, focus interaction) but you'll do the styling yourself.
  2. You want to depend on a smaller surface than full Feathers.

Directory layout

crates/bevy_ui_widgets/src/
├── lib.rs
├── button.rs
├── checkbox.rs
├── radio.rs
├── slider.rs
├── scrollbar.rs
├── core_*.rs          # Lower-level core widget components
└── …

Key abstractions

Type File Description
Button and Activate event crates/bevy_ui_widgets/src/button.rs Core button widget.
Checkbox, Checked crates/bevy_ui_widgets/src/checkbox.rs Toggleable checkbox.
Slider, SliderRange, SliderStep, SliderValue crates/bevy_ui_widgets/src/slider.rs Numeric slider.
Scrollbar, ScrollbarThumb crates/bevy_ui_widgets/src/scrollbar.rs Scrollbars (vertical/horizontal).
RadioGroup crates/bevy_ui_widgets/src/radio.rs Mutually-exclusive selection.

How it works

Each widget is a small set of components plus a system or observer that translates pointer + keyboard input into widget state changes. Widgets emit events (e.g. Activate for a button) that user code listens to. They cooperate with bevy_input_focus for keyboard navigation.

Integration points

  • Depends on: bevy_app, bevy_ecs, bevy_ui, bevy_input, bevy_input_focus, bevy_picking, bevy_a11y.
  • Depended on by: bevy_feathers, user UIs.

Entry points for modification

  • New widget: new file mirroring the existing patterns.
  • A11y improvements: plumbing through to bevy_a11y lives here.
  • Keyboard handling: systems on each widget read KeyboardInput events filtered by focus.

See also

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

bevy_ui_widgets – Bevy wiki | Factory