#bevy #gamedev #text-input #events #scroll

no-std bevy_simple_text_input

Bevy plugin for a simple single-line text input widget

18 releases (10 breaking)

Uses new Rust 2024

new 0.11.0 Apr 24, 2025
0.10.2 Jan 16, 2025
0.10.1 Dec 31, 2024
0.10.0 Nov 29, 2024
0.3.1 Nov 5, 2023

#140 in Game dev

Download history 179/week @ 2025-01-06 571/week @ 2025-01-13 363/week @ 2025-01-20 195/week @ 2025-01-27 293/week @ 2025-02-03 205/week @ 2025-02-10 171/week @ 2025-02-17 221/week @ 2025-02-24 202/week @ 2025-03-03 253/week @ 2025-03-10 152/week @ 2025-03-17 196/week @ 2025-03-24 251/week @ 2025-03-31 230/week @ 2025-04-07 212/week @ 2025-04-14 296/week @ 2025-04-21

1,004 downloads per month

MIT/Apache

260KB
639 lines

bevy_simple_text_input

crates.io docs Following released Bevy versions

An unambitious single-line text input widget for bevy_ui.

animated screenshot of text input widget gaining focus and text typed and submitted

Usage

[!IMPORTANT] Code and examples in the main branch are under development and may not be compatible with the released version on crates.io. The latest branch will contain the code from the most recent release.

See examples/basic.rs.

Features

I am not trying to build and maintain an enterprise-grade text input, just something that is good enough to be useful in small projects.

  • Scrolling
  • Keyboard cursor movement (char, word, start/end)
  • Disable / focus
  • Placeholders
  • Doesn't completely choke on unicode
  • Password masking
  • "Submit" events

Maybe

  • Input filtering
  • Length limit
  • Mouse cursor movement
  • Proper unicode grapheme support
  • IME support

Probably not

I might consider very high quality contributions in these areas, but probably won't be working on them myself. These would likely involve adding dependencies or adding lots of code that I don't want to commit to maintaining.

  • Multi-line
  • Copy / paste
  • Selection
  • Mobile

Definitely not

  • Rich text

Compatibility

bevy_simple_text_input bevy
0.11 0.16
0.10 0.15
0.8-0.9 0.14
0.4-0.7 0.13
0.3 0.12
0.1-0.2 0.11

Contributing

Please feel free to open a PR!

The code should be simple enough for users to quickly understand and modify for their own purposes. Any new dependencies must not also depend on Bevy. Ideally, we should not add any new dependencies.

Please keep PRs small and scoped to a single feature or fix.

Alternatives

If you need more features, check out bevy_ui_text_input or bevy_egui.

Dependencies

~56–89MB
~1.5M SLoC