Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Bevy Version Compatibility

mevy supports Bevy 0.15 through 0.18 via Cargo features. All API differences are handled automatically — you don’t need to change your code when switching versions.

Why Version Features?

Bevy changes its APIs between minor versions. For example, BoxShadow changed from a direct struct to Vec<ShadowStyle> in 0.16, and BorderColor changed from a single value to per-edge in 0.17. mevy handles these differences for you, but it needs to know which version you’re targeting to generate the correct code.

Required Feature

You must specify the Bevy version feature:

[dependencies]
mevy = { version = "0.3", features = ["0.18"] }

What Stays the Same

The following patterns are stable across all supported versions:

  • code!{} hex color and Val syntax
  • ui!{} field names and edge/corner selection
  • entity!{} selector syntax
  • All shorthand aliases (w, h, bg, px, etc.)

You can write the same mevy code for Bevy 0.15 and 0.18 — just change the version feature.

Version Compatibility Matrix

Featuremevy_uimevy_coremevy_ecs
0.15
0.16
0.16-rc
0.17
0.18

Version Differences

These are the API changes mevy handles automatically. You don’t need to do anything — just set the correct version feature.

box_shadow

VersionField Path
0.15BoxShadow::blur_radius (direct field)
0.16+BoxShadow::[0].blur_radius (array access)

border_radius

VersionField Path
0.15BorderRadius::top_left (direct field)
0.18+Node::border_radius.top_left (on Node)

scroll_position

VersionField Path
0.15-0.16ScrollPosition::x_offset, y_offset
0.17+ScrollPosition::x, y

line_height

VersionComponent
0.15-0.17TextFont::line_height
0.18+Separate LineHeight component

border_color

VersionStructure
0.15-0.16BorderColor(Srgba) (single value)
0.17+BorderColor { top, right, bottom, left } (per-edge)

Observer Changes

VersionTrigger TypeEntity Access
0.15Trigger::<T>trigger.entity()
0.16Trigger::<T>trigger.target()
0.17+On::<T>trigger.event_target()

ChildBuilder Changes

VersionMethods
0.15.parent_entity(), .spawn(...)
0.16+.target_entity(), .commands_mut()

ChildOf Relationship

VersionMethod
0.15.set_parent(parent)
0.16+.insert(ChildOf(parent))

See Also

  • Installation — Setup and version selection
  • Migration Guide — Step-by-step migration between versions
  • FAQ — Common questions about version compatibility