Tesserae

Layer

Description

The Layer component is a technical utility used to render content outside the main DOM tree, appending it at the end of the document. This approach bypasses layout restrictions such as CSS "overflow: hidden" and ensures that layered content (such as contextual menus or tooltips) always appears above the rest of the UI without relying on z-index manipulation.

Usage

Instantiate a Layer using the static helper method from Tesserae.UI. Use the Content method to set the inner content that should be rendered within the Layer. The visibility of the Layer can be controlled via the IsVisible property, and you may optionally provide a hosting container using the Host property to control where the Layer's content gets projected.

Methods

  • Content(IComponent content)
    Sets the inner content of the Layer.
    • content: An IComponent instance representing the content to be rendered within the Layer.

Properties

  • IsVisible (bool)
    Gets or sets a value indicating whether the Layer is currently visible.

  • Host (IComponent)
    Gets or sets the host component that controls where the Layer's content is projected. Providing a host causes the Layer to render within that container instead of being appended at the end of the document.

Samples

Basic Layer Usage

This sample demonstrates how to create a Layer, set its content, and toggle its visibility using a button click.

See also

© 2026 Tesserae. All rights reserved.