Type Item

type Item struct {
	// contains filtered or unexported fields
}

Item is one source-owned list row declaration. It keeps layout and transient interaction state explicit and allocates no auxiliary collections.

Constructors

BeginItem#

func BeginItem(canvas *ui.Canvas, theme ui.Theme, id ui.ID, bounds ui.Rect) Item

BeginItem starts an item row. ID 0 paints a preview without interaction.

Methods

Disabled#

func (item Item) Disabled() Item

Disabled renders and routes the row as inert.

LeadingSpace#

func (item Item) LeadingSpace(width float32) Item

LeadingSpace reserves room plus the standard item gap for caller-painted media such as an icon or avatar.

Media#

func (item Item) Media(variant ItemMediaVariant) Item

Media reserves the standard ItemMedia box of a variant for the item's size. Call it after Size. Paint returns the box, which the caller paints into.

Paint#

func (item Item) Paint(title, description, trailing string) ItemLayout

Paint draws the title, optional description, and optional trailing label, and returns the media box and text column it laid out.

Size#

func (item Item) Size(size ItemSize) Item

Size selects default, small, or extra-small Vega item spacing.

Variant#

func (item Item) Variant(variant ItemVariant) Item

Variant selects the row surface treatment.