appshell

package
v1.0.31-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package appshell provides a full-window application layout: an optional fixed header, navbar, aside and footer around a main content area that's automatically offset so it never sits under them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(content elements.Element, st ...styles.Styles) elements.Element

Main wraps content as an AppShell's main content area: it fills whatever space Header/Navbar/Aside/Footer leave once Config is resolved.

func New

func New(cfg Config, st ...styles.Styles) elements.Element

New returns a full-window layout: Header/Navbar/Aside/Footer (each optional) are fixed to their respective edges, and Main fills the remaining space, offset by whichever of them are present. The styles argument styles the root container; Width/Height default to -1 (fill the window).

Sizing Aside (flush right) and Footer (flush bottom) needs the window's own size, only known at layout time, so New defers building the actual child styles to a Raw element's Layout rather than computing them upfront - the usual approach elsewhere in the library (e.g. Right/Bottom-anchored Box children) only supports a nonzero offset from the far edge, since Go's int zero value can't distinguish "flush" from "not set" the way it can for Left/Top.

func Section

func Section(content func() elements.Element, st ...styles.Styles) elements.Element

Section groups content inside a Navbar/Aside, e.g. a scrollable list of nav links - a thin wrapper over Scroll, since a fixed-size sidebar is the common place content needs to scroll independently of the page.

Types

type Config

type Config struct {
	Header *Slot
	Navbar *Slot
	Aside  *Slot
	Footer *Slot
	Main   elements.Element
}

Config configures an AppShell's optional slots. Header, Navbar, Aside and Footer are optional - leave nil to omit that slot - Main is the required content area, typically built with Main.

type Slot

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

Slot is a sized AppShell region: Header/Footer are height tall, Navbar/Aside are width wide. Build one with Header, Navbar, Aside or Footer.

func Aside

func Aside(width int, content elements.Element, st ...styles.Styles) *Slot

Aside returns a Slot for Config.Aside: an aside width wide, spanning the height between Header and Footer (if present), fixed to the right (the left in a right-to-left locale).

func Footer(height int, content elements.Element, st ...styles.Styles) *Slot

Footer returns a Slot for Config.Footer: a footer height tall, spanning the full width, fixed to the bottom.

func Header(height int, content elements.Element, st ...styles.Styles) *Slot

Header returns a Slot for Config.Header: a header height tall, spanning the full width, fixed to the top.

func Navbar(width int, content elements.Element, st ...styles.Styles) *Slot

Navbar returns a Slot for Config.Navbar: a navbar width wide, spanning the height between Header and Footer (if present), fixed to the left (the right in a right-to-left locale).

Jump to

Keyboard shortcuts

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