Grid

Grid - A UI component for arranging child components in a grid layout.

This component provides:

  • Flexible grid layout with configurable columns and rows

  • Responsive grid that adapts to content and container size

  • Support for different grid item sizes and spacing

  • Alignment and justification options

  • Dynamic addition and removal of grid items

  • Support for different grid item aspect ratios

Constructors

Link copied to clipboard
constructor(options: GridOptions)

Properties

Link copied to clipboard
open override val children: StateFlow<List<MediaSfuUIComponent>>

Get all child components.

Link copied to clipboard
open override val currentStyle: ComponentStyle

Get the current style of this component.

Link copied to clipboard
open override val id: String

Unique identifier for this UI component.

Link copied to clipboard
open override val isEnabled: Boolean

Whether this component is currently enabled.

Link copied to clipboard
open override val isVisible: Boolean

Whether this component is currently visible.

Functions

Link copied to clipboard
open override fun addChild(component: MediaSfuUIComponent)

Add a child component to this layout.

Link copied to clipboard

Add a grid item to the grid.

Link copied to clipboard
open override fun applyStyle(style: ComponentStyle)

Apply a style to this component.

Link copied to clipboard

Calculate the optimal grid layout based on content.

Link copied to clipboard
open override fun clearChildren()

Clear all child components.

Link copied to clipboard
open override fun disable()

Disable this component.

Link copied to clipboard
open override fun dispose()

Dispose of this component and release resources.

Link copied to clipboard
open override fun enable()

Enable this component.

Link copied to clipboard

Get the current grid layout information.

Link copied to clipboard
fun getGridItemAt(row: Int, column: Int): GridItem?

Get a grid item at specific row and column.

Link copied to clipboard

Get all grid items.

Link copied to clipboard

Get grid items in a specific column.

Link copied to clipboard

Get grid items in a specific row.

Link copied to clipboard
open override fun hide()

Hide this component.

Link copied to clipboard
open override fun removeChild(component: MediaSfuUIComponent)

Remove a child component from this layout.

Link copied to clipboard

Remove a grid item from the grid.

Link copied to clipboard
open override fun show()

Show this component.

Link copied to clipboard
fun updateLayout(columns: Int? = null, rows: Int? = null, spacing: Float? = null)

Update the grid layout configuration.