anyuianyui
anyui-LIVE
anyui
Feedback
  • English
  • 中文
anyui-LIVE
anyui
Feedback
  • English
  • 中文
  • Introduction

    • Introduction
  • Get Started

    • Get Started
  • Workspace

    • Workspace
  • Editor

    • Overview
    • Toolbar
    • Navigator
    • Inspector
    • Display Layers
    • Event Flow Overview
    • Statusbar
    • Settings
    • Keyboard shortcuts
    • Canvas
    • Preview
    • Resource management
    • Code Viewer
    • History
  • Agent
  • Desktop
  • Data safety
  • Subjects

    • Image
    • Font Library
    • Layout
    • Symbol
    • Animation
    • Global style
    • Dynamic LVGL version
    • Dynamic Display Size Change
    • Override screen size
    • Codegen
    • User custom code
    • Transplant
    • Simulator
    • Translation
  • FAQ

A symbol is a reusable component: you design it once in the symbol library, then place as many linked copies as you need. Editing the symbol updates every copy, while each copy can keep small tweaks of its own.

Overview

TermDefinition
SymbolA component definition that lives in the symbol library and is edited on its own canvas.
InstanceA linked copy of a symbol, placed on a screen. Instances follow the definition.
Member targetA direct child of a placed symbol instance, addressed in event pickers as <instance>.<child>.

Symbols are useful for repeated interface elements such as headers, cards, toolbars, and buttons that appear on many screens. One design to maintain, one function in the generated code, and identical appearance everywhere.

Creating a symbol

  1. Open the Symbols tab in the navigator, next to Hierarchy.
  2. Click New in the symbol library header. An empty symbol opens on the canvas and the editor switches to symbol editing mode.
  3. Add widgets to the symbol exactly as you would on a screen.
  4. Click the check button in the symbol toolbar to save the definition.

Symbol library actions take effect immediately:

  • Rename - click the pencil icon on the row.
  • Reorder - drag a row up or down. The order is also the order symbols appear in the widget palette.
  • Delete - see Deleting a symbol.

Only the artwork inside the symbol needs to be saved; renaming, reordering, and deleting apply as you do them.

Editing a symbol

Selecting a symbol in the library opens its definition on the canvas and the symbol toolbar above the canvas shows Editing symbol with its name. An amber dot marks unsaved changes.

ControlBehavior
Undo / RedoStep through changes made in this editing session.
Discard (✕)Discard unsaved changes and close the editor; asks for confirmation.
Save (✓)Save the definition and update its instances.

Discard and Save are enabled only while the symbol has unsaved changes.

Note

Symbol edits are not saved automatically. Switching to another symbol, or back to the Hierarchy tab, prompts Discard unsaved changes? when the current definition has unsaved edits. Confirm to return to the last saved version. Library operations (renaming, reordering, deleting) are saved to the project immediately; discarding only affects the current symbol's unsaved edits and does not undo those operations.

An unsaved symbol draft also blocks export: finish with Save or discard with ✕ before building or exporting the project.

Events

The current Symbol implementation separates reusable artwork from interaction ownership:

  • A Symbol definition stores the reusable widget tree.
  • Event handlers can only be authored on a placed instance, not inside the Symbol draft.
  • Event pickers can address the instance root, and also the instance's direct children.

When an event picker reaches into a placed Symbol, it shows the child as <instance>.<child>, such as card_1.title. This is a member target: it names one direct child of that placed instance without exposing the clone id directly.

Use this model when a screen-level widget needs to change part of a placed Symbol, or when you need to bind an event source to one of the instance's direct children.

Note

Only direct children are addressable this way. A deeper grandchild does not get its own <instance>.<child>.<grandchild> path, and Symbols cannot be nested.

Creating instances

Expand the widget bar, and the Symbols group in the widget bar lists every symbol you can place:

  • Click a tile to add an instance to the active screen or a container on it.
  • Drag a tile onto the canvas to decide the position yourself.

Every placed copy is linked. To place the same symbol many times, repeat either action.

Note

The palette is read-only in preview mode. Symbols cannot be nested, so you cannot place a Symbol inside another Symbol.

Working with an instance

An instance behaves as a single object on the canvas: its internal widgets are locked, clicking any part of it selects the instance, and the hierarchy shows it as a leaf. To change its content, edit the symbol.

What you can change per instance:

SettingBehavior
PositionAlways set by the instance; where you place it is never taken from the definition.
Display nameLocal to the instance and free to edit.
IdentifierLocal to the instance; used as the generated C variable name.
Other rowsShown by Edit Instance in the inspector, see below.

The inspector starts collapsed for an instance and shows only the rows that are clearly local. Above them sit:

  • Edit Symbol - opens the definition's editor.
  • More actions (…) - contains Edit Instance, which reveals the rest of the widget rows.

Editing a row to a different value makes that value local to the instance. Local values are sticky: they keep their value the next time the symbol is saved.

Once an instance has local values, the menu offers Reset, which restates the symbol's design over everything this instance changed. Its position, name, identifier, children, and link stay as they are.

Saving a symbol with existing instances

Saving a definition updates every instance:

  • Values you never touched on an instance follow the new design.
  • Values you changed on an instance keep your value.
  • A property you removed on an instance stays removed; a later definition edit does not bring it back.
  • Event handlers bound on the instance root or its direct children stay with that instance.
  • Member targets keep working through a normal definition save, because they resolve by the definition child they name instead of by a clone id.
  • If you remove a direct child that an existing member target used, that target becomes unavailable and needs to be repointed.
  • Renaming a direct child updates how it is displayed in pickers; the stored reference itself does not need to be rewritten by hand.

Use Reset on an instance when you want it to follow the symbol again.

Deleting a symbol

Deleting a symbol removes its library entry only. While the symbol is still used by instances, the editor refuses with Symbol is still in use, which names the number of widgets involved. Delete those instances first, then delete the symbol.

Generated code

Each symbol becomes one reusable function in the generated output, and instances reuse it rather than duplicating the design:

  • A definition is emitted as create_symbol_<identifier>(lv_obj_t * parent) in generated/symbols.c and generated/symbols.h.
  • An untouched instance emits one call plus its position.
  • An instance with local values emits the call, its position, and only the differences it states.
  • The children inside an instance are not emitted separately.

When an event targets a direct child of a placed Symbol, generated code keeps that reference tied to the instance rather than emitting a raw clone id. This is why the event picker uses <instance>.<child> names and why those references survive a normal Symbol save.

Prefixing one symbol with create_symbol_ makes it easy to find the code behind each instance; see the codegen guide for the generated file layout.

Related guides

  • Layout - arrange the widgets inside a symbol.
  • Image - assign image resources to widgets inside a symbol.
  • Font library - typography for symbol content.
  • Codegen - how symbols become generated functions.
  • Inspector - edit Symbol instances, local overrides, and event rows.
  • Overview - design screens on the canvas.
  • Navigator - screens, hierarchy, and the Symbols tab.
  • Event Flow Overview - inspect event relationships around a Symbol instance.
  • Preview - verify a symbol's appearance and behavior.
Prev
Layout
Next
Animation