kit

package
v0.0.0-...-c892017 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 8 Imported by: ? modules, 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 kit holds helpers three or more components share.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Enter fades an element in from 4 DIP below.
	Enter = ui.ElementTransition{
		Duration: 160 * time.Millisecond,
		Enter:    &ui.Motion{Y: 4},
		Exit:     &ui.Motion{Y: 4},
	}
	// Pop scales an element in and out with a bounce.
	Pop = ui.ElementTransition{
		Animation: &popSpring,
		Enter:     &ui.Motion{Scale: 0.9},
		Exit:      &ui.Motion{Scale: 0.9},
	}
)

Functions

func Arrive

func Arrive(e ui.Element, from ui.Pose, delay time.Duration) ui.Element

Arrive eases from a pose to rest on first build.

func Card

func Card(c *ui.Context) ui.Element

Card returns the shared card surface.

func CardHead

func CardHead(c *ui.Context, glyph, title string, trailing func())

CardHead is a card's title row: icon, title, then trailing.

func Changed

func Changed(e ui.Element, cue sound.Cue) bool

Changed reports e.Changed and plays cue when true.

func Chip

func Chip(c *ui.Context, text string, ink ui.Color) ui.Element

Chip is a small tinted pill; new text cross-fades.

func Clicked

func Clicked(e ui.Element, cue sound.Cue) bool

Clicked reports e.Clicked and plays cue when true.

func Glass

func Glass(t *ui.Theme, alpha float32) ui.Color

Glass is a translucent surface colour that reads over the wallpaper.

func Hairline

func Hairline(t *ui.Theme) ui.Color

Hairline is the edge colour of glass and of windows.

func IndexFold

func IndexFold(s, q string) (int, int)

IndexFold finds q in s ignoring case, as byte bounds.

func Inside

func Inside(radius float32, fn func(p *ui.Painter, r ui.Rect)) func(p *ui.Painter, r ui.Rect)

Inside clips fn to its box rounded by radius.

func Lift

func Lift(e ui.Element) ui.Element

Lift raises e 2 DIP while it is hovered.

func Log

func Log(component, event string, args ...any)

Log records a component state change at debug level.

func Marked

func Marked(t *ui.Theme, s string, lo, hi int) []ui.Span

Marked spans s with lo..hi bold in the accent.

func Muted

func Muted(c *ui.Context, s string) ui.Element

Muted returns secondary text.

func Numeric

func Numeric(c *ui.Context, s string) ui.Element

Numeric returns text whose digits roll on change.

func Press

func Press(e ui.Element) ui.Element

Press shrinks e while it is pressed.

func Resting

func Resting(e ui.Element) bool

Resting reports e let go and still.

func Settle

func Settle(c *ui.Context, e ui.Element, used []float32, read func() []float32)

Settle rebuilds when e's laid-out read differs from used.

func Shade

func Shade(a float32) ui.Color

Shade is black at alpha a, for shadows.

func Slide

func Slide(c *ui.Context, key int, content func())

Slide keys content, sliding in toward the side moved to.

func Stagger

func Stagger(c *ui.Context, list, row ui.Element, i int) ui.Element

Stagger arrives a row, staggered while its list is young.

Types

This section is empty.

Jump to

Keyboard shortcuts

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