Skip to main content

ElementKind

Enum ElementKind 

Source
pub enum ElementKind {
Show 47 variants Container(ContainerProps), Semantics(SemanticsProps), SemanticFlex(SemanticFlexProps), FocusScope(FocusScopeProps), LayoutQueryRegion(LayoutQueryRegionProps), InteractivityGate(InteractivityGateProps), HitTestGate(HitTestGateProps), FocusTraversalGate(FocusTraversalGateProps), ForegroundScope(ForegroundScopeProps), Opacity(OpacityProps), EffectLayer(EffectLayerProps), BackdropSourceGroup(BackdropSourceGroupProps), MaskLayer(MaskLayerProps), CompositeGroup(CompositeGroupProps), ViewCache(ViewCacheProps), VisualTransform(VisualTransformProps), RenderTransform(RenderTransformProps), FractionalRenderTransform(FractionalRenderTransformProps), Anchored(AnchoredProps), Pressable(PressableProps), PointerRegion(PointerRegionProps), TextInputRegion(TextInputRegionProps), InternalDragRegion(InternalDragRegionProps), ExternalDragRegion(ExternalDragRegionProps), RovingFlex(RovingFlexProps), Stack(StackProps), Column(ColumnProps), Row(RowProps), Spacer(SpacerProps), Text(TextProps), StyledText(StyledTextProps), SelectableText(SelectableTextProps), TextInput(TextInputProps), TextArea(TextAreaProps), ResizablePanelGroup(ResizablePanelGroupProps), VirtualList(VirtualListProps), Flex(FlexProps), Grid(GridProps), Image(ImageProps), Canvas(CanvasProps), ViewportSurface(ViewportSurfaceProps), SvgIcon(SvgIconProps), Spinner(SpinnerProps), HoverRegion(HoverRegionProps), WheelRegion(WheelRegionProps), Scroll(ScrollProps), Scrollbar(ScrollbarProps),
}

Variants§

§

Container(ContainerProps)

§

Semantics(SemanticsProps)

§

SemanticFlex(SemanticFlexProps)

A flex container that also contributes a semantics node with a fixed role.

This is used by higher-level libraries (e.g. Radix/shadcn ports) to model structural grouping (role="group") without introducing an extra semantics wrapper layer that would otherwise be separated from layout.

§

FocusScope(FocusScopeProps)

§

LayoutQueryRegion(LayoutQueryRegionProps)

A layout wrapper used for frame-lagged container queries (ADR 0231).

This is paint- and input-transparent. It exists to provide a stable, queryable bounds snapshot for component-layer “responsive” policies that must adapt to panel width rather than viewport width.

§

InteractivityGate(InteractivityGateProps)

A transparent wrapper that gates subtree presence and interactivity.

This is a mechanism-oriented primitive intended to support Radix-style authoring outcomes like forceMount while still being able to make a subtree non-interactive (click/keyboard) or fully absent from layout/paint, without deleting the subtree (so per-element state can be preserved).

§

HitTestGate(HitTestGateProps)

A transparent wrapper that gates pointer hit-testing for a subtree without affecting focus traversal or semantics.

When hit_test == false, the subtree remains present for layout/paint and can still participate in keyboard focus traversal, but pointer hit-testing will ignore the subtree (click-through behavior).

This is intended to support editor-grade “peek through” surfaces (ImGui-style NoMouseInputs) without making the subtree inert for keyboard navigation.

§

FocusTraversalGate(FocusTraversalGateProps)

A transparent wrapper that gates focus traversal for a subtree without affecting pointer hit-testing or semantics.

When traverse == false, the subtree remains present for layout/paint and pointer hit-testing, but focus traversal will not recurse into the subtree.

This is intended to support editor-grade “disabled but hoverable” surfaces (e.g. tooltips over disabled items) without requiring authors to restructure hit-testing.

§

ForegroundScope(ForegroundScopeProps)

A paint- and input-transparent wrapper that installs a subtree-local foreground color.

This is the declarative equivalent of CSS currentColor inheritance or Flutter’s IconTheme/DefaultTextStyle foreground behavior: descendants that opt into inheriting foreground color can resolve it from the nearest ForegroundScope.

Note: v2 only covers foreground color. A richer text-style stack (font/size/weight/etc.) can be layered on later without changing the element tree contract.

§

Opacity(OpacityProps)

§

EffectLayer(EffectLayerProps)

A scoped post-processing effect group wrapper (ADR 0117).

§

BackdropSourceGroup(BackdropSourceGroupProps)

A scoped backdrop source group wrapper (ADR 0305).

§

MaskLayer(MaskLayerProps)

A scoped alpha mask layer wrapper (ADR 0239).

This emits a SceneOp::PushMask/PopMask pair around the subtree during painting. The mask’s computation bounds are the wrapper’s final layout bounds.

§

CompositeGroup(CompositeGroupProps)

A scoped isolated compositing group wrapper (ADR 0247).

This emits a SceneOp::PushCompositeGroup/PopCompositeGroup pair around the subtree during painting. The compositing group’s computation bounds are the wrapper’s final layout bounds.

§

ViewCache(ViewCacheProps)

Experimental view-level cache boundary wrapper.

When enabled by the runtime, this marks a subtree as a cache root for range-replay and invalidation containment experiments (see docs/workstreams/gpui-parity-refactor/gpui-parity-refactor.md).

§

VisualTransform(VisualTransformProps)

§

RenderTransform(RenderTransformProps)

§

FractionalRenderTransform(FractionalRenderTransformProps)

§

Anchored(AnchoredProps)

§

Pressable(PressableProps)

§

PointerRegion(PointerRegionProps)

§

TextInputRegion(TextInputRegionProps)

A focusable, text-input-capable event region primitive.

Unlike TextInput / TextArea, this does not own an internal text model. It exists as a mechanism-only building block for ecosystem text surfaces (e.g. code editors) that need to receive Event::TextInput / Event::Ime / clipboard events while owning their own buffer and rendering pipeline.

§

InternalDragRegion(InternalDragRegionProps)

An internal drag event listener region primitive.

This is a mechanism-only building block: it does not own policy for any particular drag kind, and is intended to be used by higher-level layers (workspace, docking, etc.).

§

ExternalDragRegion(ExternalDragRegionProps)

An external OS drag-and-drop event listener region primitive.

This receives Event::ExternalDrag (Enter/Over/Drop/Leave) events and is intended to be used by higher-level layers to implement portable file-drop workflows (ADR 0053).

§

RovingFlex(RovingFlexProps)

§

Stack(StackProps)

§

Column(ColumnProps)

§

Row(RowProps)

§

Spacer(SpacerProps)

§

Text(TextProps)

§

StyledText(StyledTextProps)

§

SelectableText(SelectableTextProps)

§

TextInput(TextInputProps)

§

TextArea(TextAreaProps)

§

ResizablePanelGroup(ResizablePanelGroupProps)

§

VirtualList(VirtualListProps)

§

Flex(FlexProps)

§

Grid(GridProps)

§

Image(ImageProps)

§

Canvas(CanvasProps)

A declarative, leaf canvas element for custom scene emission (ADR 0141).

§

ViewportSurface(ViewportSurfaceProps)

Composites an app-owned render target (Tier A; ADR 0007 / ADR 0038 / ADR 0123).

§

SvgIcon(SvgIconProps)

§

Spinner(SpinnerProps)

§

HoverRegion(HoverRegionProps)

§

WheelRegion(WheelRegionProps)

An event-only wheel listener that updates an imperative scroll handle.

Unlike Scroll, this element does not translate its children; it only mutates the provided ScrollHandle and invalidates an optional target.

§

Scroll(ScrollProps)

§

Scrollbar(ScrollbarProps)

Trait Implementations§

Source§

impl Clone for ElementKind

Source§

fn clone(&self) -> ElementKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ElementKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more