rightpanel

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module interface {
	ModelName() string
}

Module is the interface the consumer must satisfy to provide the layout ID. Any struct with a ModelName() string method qualifies (e.g. ORM model structs).

type RightPanel

type RightPanel struct {
	Element

	// Module provides the ID for the root wrapper element.
	Module Module

	// Title is rendered as <h1> in the header.
	Title string

	// Head is rendered beside the <h1> (e.g. status badge, icon).
	Head Component

	// HeadControls is rendered below the title row (e.g. select with search).
	HeadControls Component

	// Article is the main content area.
	Article Component

	// AsideControls is rendered at the top of the aside panel (e.g. search + filter).
	AsideControls Component

	// Aside is the content area of the aside panel (e.g. detail view, info card).
	Aside Component
}

RightPanel is a two-column layout skeleton:

  • Left: main content area with header (title + controls) and article.
  • Right: aside panel with its own header (controls) and content.

All slots are optional. A nil slot is simply not rendered. The layout does not define what the slots contain — that is the consumer's job.

IMPORTANT: All Component implementors passed as slots MUST embed Element as a value, not as a pointer. See tinywasm/dom interface.dom.go for details.

Usage:

panel := &rightpanel.RightPanel{
    Module:        myModel,          // implements ModelName() string
    Title:         "Users",
    HeadControls:  mySelectSearch,
    Article:       myTable,
    AsideControls: myFilterBar,
    Aside:         myDetailPanel,
}
panel.Render()

func (*RightPanel) Render

func (r *RightPanel) Render() *Element

Render builds the layout element tree. Implements ViewRenderer.

func (*RightPanel) RenderCSS

func (r *RightPanel) RenderCSS() *Stylesheet

RenderCSS implements CSSProvider.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL