UI examples
The engine's UI examples: what each one shows, whether it runs in a browser and the command that runs it.
Nodes and layout, text, images, buttons, scrolling, focus, widgets and UI rendering. There are 66 examples on this page. For the concepts behind them, see UI.
Run any of them from the engine core's workspace (the folder of the engine source that holds the neo crate's Cargo.toml); see Run an example.
Examples#
| Example | What it shows | Web | Run |
|---|---|---|---|
| Anchor Layout | Shows an 'anchor layout' style of ui layout | Yes | cargo run --example anchor_layout |
| Borders | Demonstrates how to create a node with a border | Yes | cargo run --example borders |
| Box Shadow | Demonstrates how to create a node with a shadow | Yes | cargo run --example box_shadow --features neo_feathers |
| Button | Illustrates creating and updating a button | Yes | cargo run --example button |
| CSS Grid | An example for CSS Grid layout | Yes | cargo run --example grid |
| Directional Navigation | Demonstration of automatic directional navigation based on UI element positions | Yes | cargo run --example directional_navigation |
| Directional Navigation Overrides | Demonstration of automatic directional navigation between UI elements with manual overrides | Yes | cargo run --example directional_navigation_overrides |
| Display and Visibility | Demonstrates how Display and Visibility work in the UI. | Yes | cargo run --example display_and_visibility --features neo_feathers |
| Drag to Scroll | This example tests scale factor, dragging and scrolling | Yes | cargo run --example drag_to_scroll |
| Editable Text Filter | Demonstrates an 8-character hex input using EditableTextFilter | Yes | cargo run --example editable_text_filter |
| Feathers Counter | Simple counter using feathers | Yes | cargo run --example feathers_counter --features neo_feathers |
| Feathers Number Input | Feathers Number Input Options | Yes | cargo run --example feathers_number_input --features neo_feathers |
| Feathers Widgets | Gallery of Feathers Widgets | Yes | cargo run --example feathers_gallery --features neo_feathers |
| Fixed Node | Demonstrates how to use FixedNode to lay out a UI node as a root node | Yes | cargo run --example fixed_node |
| Flex Layout | Demonstrates how the AlignItems and JustifyContent properties can be composed to layout nodes and position text | Yes | cargo run --example flex_layout |
| Font Atlas Debug | Illustrates how FontAtlases are populated (used to optimize text rendering internally) | Yes | cargo run --example font_atlas_debug |
| Font Queries | Demonstrates font querying | Yes | cargo run --example font_query |
| Font Variations | Demonstrates how to use OpenType font variations. | Yes | cargo run --example font_variations |
| Font Weights | Demonstrates how to use font weights. | Yes | cargo run --example font_weights |
| Generic Font Families | Demonstrates how to use generic font families | Yes | cargo run --example generic_font_families --features system_font_discovery |
| Ghost Nodes | Demonstrates the use of Ghost Nodes to skip entities in the UI layout hierarchy | Yes | cargo run --example ghost_nodes --features ghost_nodes |
| Gradients | An example demonstrating gradients | Yes | cargo run --example gradients |
| Headless Tabs | Demonstrates controlled and self-updating headless tab lists | Yes | cargo run --example headless_tabs |
| Headless Tree | Demonstrates the headless tree view with lazy population and keyboard navigation | Yes | cargo run --example headless_tree |
| Image Node | Demonstrates how to create an image node | Yes | cargo run --example image_node |
| Image Node Resizing | Demonstrates how to resize an image node | Yes | cargo run --example image_node_resizing |
| IME Support | Demonstrates IME (Input Method Editor) support for text input | Yes | cargo run --example ime_support --features system_font_discovery |
| Inline Images | Demonstrates how to display images inline with text | Yes | cargo run --example inline_image |
| Letter Spacing | Demonstrates the letter spacing feature | Yes | cargo run --example letter_spacing |
| Multiline Text Input | Demonstrates a single multiline EditableText widget | Yes | cargo run --example multiline_text_input |
| Multiple Text Inputs | Demonstrates multiple text inputs | Yes | cargo run --example multiple_text_inputs |
| Overflow | Simple example demonstrating overflow behavior | Yes | cargo run --example overflow |
| Overflow and Clipping Debug | An example to debug overflow and clipping behavior | Yes | cargo run --example overflow_debug |
| Overflow Clip Margin | Simple example demonstrating the OverflowClipMargin style property | Yes | cargo run --example overflow_clip_margin |
| Overflow Transform | Demonstrates nested transformed UI clipping | Yes | cargo run --example overflow_transform |
| Relative Cursor Position | Showcases the RelativeCursorPosition component | Yes | cargo run --example relative_cursor_position |
| Render UI to Texture | An example of rendering UI as a part of a 3D world | Yes | cargo run --example render_ui_to_texture |
| Scroll | Demonstrates scrolling UI containers | Yes | cargo run --example scroll |
| Scrollbars | Demonstrates use of core scrollbar in NEO UI | Yes | cargo run --example scrollbars |
| Size Constraints | Demonstrates how the to use the size constraints to control the size of a UI node. | Yes | cargo run --example size_constraints |
| Stacked Gradients | An example demonstrating stacked gradients | Yes | cargo run --example stacked_gradients |
| Standard Widgets | Demonstrates use of core (headless) widgets in NEO UI | Yes | cargo run --example standard_widgets |
| Standard Widgets (w/Observers) | Demonstrates use of core (headless) widgets in NEO UI, with Observers | Yes | cargo run --example standard_widgets_observers |
| Strikethrough and Underline | Demonstrates how to display text with strikethrough and underline. | Yes | cargo run --example strikethrough_and_underline |
| System Fonts | Demonstrates how to use system fonts | Yes | cargo run --example system_fonts --features system_font_discovery |
| Tab Navigation | Demonstration of Tab Navigation between UI elements | Yes | cargo run --example tab_navigation |
| Text | Illustrates creating and updating text | Yes | cargo run --example text |
| Text Background Colors | Demonstrates text background colors | Yes | cargo run --example text_background_colors |
| Text Debug | An example for debugging text layout | Yes | cargo run --example text_debug |
| Text Input | Demonstrates a simple, unstyled text input widget | Yes | cargo run --example text_input |
| Text Wrap Debug | Demonstrates text wrapping | Yes | cargo run --example text_wrap_debug |
| Transparency UI | Demonstrates transparency for UI | Yes | cargo run --example transparency_ui |
| UI Drag and Drop | Demonstrates dragging and dropping UI nodes | Yes | cargo run --example ui_drag_and_drop |
| UI Material | Demonstrates creating and using custom Ui materials | Yes | cargo run --example ui_material |
| UI Scaling | Illustrates how to scale the UI | Yes | cargo run --example ui_scaling |
| UI Target Camera | Demonstrates how to use UiTargetCamera and camera ordering. | Yes | cargo run --example ui_target_camera |
| UI Texture Atlas | Illustrates how to use TextureAtlases in UI | Yes | cargo run --example ui_texture_atlas |
| UI Texture Atlas Slice | Illustrates how to use 9 Slicing for TextureAtlases in UI | Yes | cargo run --example ui_texture_atlas_slice |
| UI Texture Slice | Illustrates how to use 9 Slicing in UI | Yes | cargo run --example ui_texture_slice |
| UI Texture Slice Flipping and Tiling | Illustrates how to flip and tile images with 9 Slicing in UI | Yes | cargo run --example ui_texture_slice_flip_and_tile |
| UI Transform | An example demonstrating how to translate, rotate and scale UI elements. | Yes | cargo run --example ui_transform |
| UI Z-Index | Demonstrates how to control the relative depth (z-position) of UI elements | Yes | cargo run --example z_index |
| Vertical Slider | Simple example showing vertical and horizontal slider widgets with snap behavior and value labels | Yes | cargo run --example vertical_slider |
| Viewport Node | Demonstrates how to create a viewport node with picking support | Yes | cargo run --example viewport_node |
| Virtual Keyboard | Example demonstrating a virtual keyboard widget | Yes | cargo run --example virtual_keyboard --features neo_feathers |
| Window Fallthrough | Illustrates how to access winit::window::Window's hittest functionality. | No | cargo run --example window_fallthrough |