ef-hierarchy

Layer panel. Displays the element tree of the target composition.

Shows all temporal elements in the target composition as a collapsible, selectable tree. Fires hierarchy-select when an element is clicked and hierarchy-reorder when elements are dragged to a new position.

AttributeReact propTypeDefaultDescription
headerheaderstring""Header text shown above the tree (when `show-header`).
show-headershowHeaderbooleanfalseWhether to show the header row.
targettargetstring""ID of the target element this component controls or reads from.
<ef-hierarchy target="root" show-header header="Layers"
  style="display: block; width: 240px;"></ef-hierarchy>
EventDetailDescription
hierarchy-highlight{ element: Element | null }Fires when the highlighted element changes (e.g. hovering it in `ef-canvas`), via {@link EFHierarchyElement#setHighlighted}.
hierarchy-reorder{ sourceId: string; targetId: string; position: "before" | "after" | "inside" }Fires when the user drags a row to a new position.
hierarchy-select{ elementId: string | null }Fires when the user clicks an element row, or {@link EFHierarchyElement#select} is called programmatically.

Public Methods

MethodDescription
select(elementId: string | null): voidProgrammatically select an element by ID (or clear with `null`).
getSelectedElementId(): string | nullThe first currently-selected element's id, or `null` if nothing is selected.
getHighlightedElement(): Element | nullThe element currently highlighted via {@link setHighlighted}, or `null`.
setHighlighted(el: Element | null): voidSets the element highlighted from outside `ef-hierarchy` (e.g. hovering it in `ef-canvas`) and dispatches `hierarchy-highlight`.

CSS Custom Properties

PropertyDefaultDescription
--hierarchy-bgBackground color of the tree container.
--hierarchy-borderBorder color (header divider).
--hierarchy-drop-indicatorColor of the drag-and-drop reorder indicator line.
--hierarchy-hover-bgRow background color on hover.
--hierarchy-selected-bgRow background color when selected.
--hierarchy-textText color.

Each row is rendered by an internal ef-hierarchy-item:

PropertyDefaultDescription
--hierarchy-drop-indicator#3b82f6Color of the drag-and-drop reorder indicator line.
--hierarchy-indent0.75remIndent width per nesting level.
--hierarchy-item-font-size0.75remRow label font size.
--hierarchy-item-height1.5remRow height.
--hierarchy-item-padding-left0.5remRow left padding.

CSS Parts

PartDescription
headerOptional header above the tree items (when `show-header`).
listOuter container wrapping the hierarchy tree.

Each row is rendered by an internal ef-hierarchy-item, which exposes its own parts:

PartDescription
badgeElement-type badge span.
childrenWrapper around nested child items.
labelElement name text span.
rowItem row container (receives `data-focused` and `data-selected` attributes).
ef-hierarchy-item::part(row):hover { background: rgba(255, 255, 255, 0.05); }
ef-hierarchy-item::part(label)     { font-size: 0.75rem; }