feedback

package
v0.0.0-...-1c55e6a Latest Latest
Warning

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

Go to latest
Published: Nov 10, 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 feedback holds alerts, progress, loaders and states.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alert

func Alert(c *ui.Context, tone Tone, title, body string) ui.Element

Alert is a tinted message box that slides in.

func AnnouncementBar

func AnnouncementBar(c *ui.Context, messages []string, o AnnouncementBarOptions) ui.Element

AnnouncementBar slides messages up in turn; Changed marks rotations.

func Attention

func Attention(c *ui.Context, on bool, content func()) ui.Element

Attention pulses a ring around its content while on.

func Banner(c *ui.Context, message, action string, open *bool, o BannerOptions) (root, act ui.Element)

Banner is a full-width bar that slides down.

func BarsLoader

func BarsLoader(c *ui.Context, label string) ui.Element

BarsLoader is equalizer bars rising and falling.

func Battery

func Battery(c *ui.Context, label string, level float64, charging bool) ui.Element

Battery fills to a level; charging pulses a bolt.

func Beacon

func Beacon(c *ui.Context, label, tip string) ui.Element

Beacon is a pulsing hotspot; a click opens its tip.

func Busy

func Busy(c *ui.Context, busy bool, working, done string) ui.Element

Busy is a spinner and text fading to done.

func Callout

func Callout(c *ui.Context, tone Tone, title string, content func()) ui.Element

Callout is a tinted box whose left border grows in.

func ConnectionStatus

func ConnectionStatus(c *ui.Context, state Connection, o ConnectionStatusOptions) ui.Element

ConnectionStatus is a colored dot and text; reconnecting pulses.

func DismissibleAlert

func DismissibleAlert(c *ui.Context, tone Tone, title, body string, open *bool, o DismissibleAlertOptions) ui.Element

DismissibleAlert is a closable alert that collapses out.

func DotsLoader

func DotsLoader(c *ui.Context, label string) ui.Element

DotsLoader is three dots bouncing in turn.

func EmptyState

func EmptyState(c *ui.Context, glyph, title, text, action string) (root, act ui.Element)

EmptyState is icon, title, text and action rising in.

func ErrorList

func ErrorList(c *ui.Context, errors []FormError, o ErrorListOptions) ui.Element

ErrorList lists field errors; a click focuses the field.

func ErrorState

func ErrorState(c *ui.Context, message string, o ErrorStateOptions) (root, retry ui.Element)

ErrorState is a shaking error icon, message and Retry.

func FieldError

func FieldError(c *ui.Context, message string) ui.Element

FieldError is error text that shakes in; empty shows nothing.

func Gauge

func Gauge(c *ui.Context, label string, value, lo, hi float64, o GaugeOptions) ui.Element

Gauge is a half circle whose needle springs.

func Hint

func Hint(c *ui.Context, text string) ui.Element

Hint is muted help text with an info icon.

func IndeterminateBar

func IndeterminateBar(c *ui.Context, label string) ui.Element

IndeterminateBar is a segment sliding along a track.

func InlineMessage

func InlineMessage(c *ui.Context, tone Tone, text string) ui.Element

InlineMessage is tone icon and text fading in.

func LevelMeter

func LevelMeter(c *ui.Context, label string, level float64) ui.Element

LevelMeter is audio-style level bars whose peak falls back.

func LiveDot

func LiveDot(c *ui.Context, o LiveDotOptions) ui.Element

LiveDot is a pulsing red dot beside "LIVE".

func LoadingVeil

func LoadingVeil(c *ui.Context, loading bool, o LoadingVeilOptions, content func()) ui.Element

LoadingVeil dims its content under a spinner while loading.

func Maintenance

func Maintenance(c *ui.Context, o MaintenanceOptions) ui.Element

Maintenance is a rocking tools icon and a message.

func NotFound

func NotFound(c *ui.Context, o NotFoundOptions) (root, home ui.Element)

NotFound is a code, message and home action rising in.

func Notice

func Notice(c *ui.Context, glyph, title, body string) ui.Element

Notice is a centered message that scales in.

func OfflineState

func OfflineState(c *ui.Context, o OfflineStateOptions) (root, retry ui.Element)

OfflineState is a pulsing offline icon, message and Retry.

func OrbitLoader

func OrbitLoader(c *ui.Context, label string) ui.Element

OrbitLoader is a dot orbiting a ring.

func ProgressBar

func ProgressBar(c *ui.Context, label string, value float64) ui.Element

ProgressBar is a bar whose fill eases to the value.

func ProgressRing

func ProgressRing(c *ui.Context, label string, value float64, o ProgressRingOptions) ui.Element

ProgressRing is a circle whose arc draws to the value.

func PulseLoader

func PulseLoader(c *ui.Context, label string) ui.Element

PulseLoader is a circle sending rings outward.

func QuotaBar

func QuotaBar(c *ui.Context, label string, used, limit float64, o QuotaBarOptions) ui.Element

QuotaBar is used of a limit; Warning past 80%.

func RetryIn

func RetryIn(c *ui.Context, at time.Time, o RetryInOptions) ui.Element

RetryIn counts down whole seconds, then enables Retry.

func SaveStatus

func SaveStatus(c *ui.Context, saving bool, o SaveStatusOptions) ui.Element

SaveStatus cross-fades a saving spinner to a saved check.

func SegmentProgress

func SegmentProgress(c *ui.Context, label string, n, done int) ui.Element

SegmentProgress is n segments filling in order.

func ServiceStatus

func ServiceStatus(c *ui.Context, services []Service, o ServiceStatusOptions) ui.Element

ServiceStatus is service rows with status dots and uptime.

func Signal

func Signal(c *ui.Context, label string, strength int) ui.Element

Signal is four rising bars, strength 0 to 4.

func Skeleton

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

Skeleton is a placeholder block with a moving sheen.

func SkeletonCard

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

SkeletonCard is a sheen image block, title and lines.

func SkeletonList

func SkeletonList(c *ui.Context, rows int) ui.Element

SkeletonList is rows of a sheen avatar and two lines.

func SkeletonText

func SkeletonText(c *ui.Context, lines int) ui.Element

SkeletonText is n sheen lines, the last one shorter.

func Snackbar

func Snackbar(c *ui.Context, message, action string, open *bool) (root, act ui.Element)

Snackbar is a dark action bar that slides up.

func Spin

func Spin(c *ui.Context, label string, o SpinOptions) ui.Element

Spin is an arc turning around a faint ring.

func StepCount

func StepCount(c *ui.Context, step, total int, o StepCountOptions) ui.Element

StepCount is "Step 2 of 5" over a filling bar.

func StorageBar

func StorageBar(c *ui.Context, label string, parts []StoragePart, total float64, o StorageBarOptions) ui.Element

StorageBar is a usage bar of growing parts, with legend.

func Strength

func Strength(c *ui.Context, label string, score int, o StrengthOptions) ui.Element

Strength is password strength 0 to 4: bars, word.

func StripedProgress

func StripedProgress(c *ui.Context, label string, value float64) ui.Element

StripedProgress is a bar whose fill carries moving stripes.

func SuccessState

func SuccessState(c *ui.Context, title, text, action string) (root, act ui.Element)

SuccessState is a drawing check, title and action.

func SyncStatus

func SyncStatus(c *ui.Context, state SyncState, o SyncStatusOptions) ui.Element

SyncStatus is a sync icon and text; syncing spins.

func TimeLeftBar

func TimeLeftBar(c *ui.Context, label string, ends time.Time, total time.Duration) ui.Element

TimeLeftBar is a bar draining until ends, total long.

func ToastCard

func ToastCard(c *ui.Context, tone Tone, title, body string, o ToastCardOptions) (root, act, dismiss ui.Element)

ToastCard is one toast: icon, title, body, action and close.

func Toaster

func Toaster(c *ui.Context, o ToasterOptions) ui.Element

Toaster styles window toasts; Type picks info, success, warning, error.

func UndoToast

func UndoToast(c *ui.Context, message string, open *bool, o UndoToastOptions) (root, undo ui.Element)

UndoToast is a toast with Undo and a countdown ring.

func UnlockToast

func UnlockToast(c *ui.Context, title, text string, open *bool) ui.Element

UnlockToast is an achievement toast with a shine passing once.

func UploadProgress

func UploadProgress(c *ui.Context, uploads []Upload) ui.Element

UploadProgress is file rows with bars that come and go.

Types

type AnnouncementBarOptions

type AnnouncementBarOptions struct {
	// Every is how long each message shows; 4 s.
	Every time.Duration
}

AnnouncementBarOptions tune an AnnouncementBar.

type BannerOptions

type BannerOptions struct {
	// Tone colors the bar; ToneInfo when zero.
	Tone Tone
	// Close names the close button; "Dismiss" when empty.
	Close string
}

BannerOptions tune a Banner.

type Connection

type Connection uint8

Connection is online, reconnecting or offline.

const (
	Online Connection = iota
	Reconnecting
	Offline
)

The three connection states.

type ConnectionStatusOptions

type ConnectionStatusOptions struct {
	Online, Reconnecting, Offline string
}

ConnectionStatusOptions tune a ConnectionStatus; empty copy reads English.

type DismissibleAlertOptions

type DismissibleAlertOptions struct {
	// Close names the close button; "Dismiss" when empty.
	Close string
}

DismissibleAlertOptions tune a DismissibleAlert.

type ErrorListOptions

type ErrorListOptions struct {
	// Title heads the list; "Fix these fields" when empty.
	Title string
}

ErrorListOptions tune an ErrorList.

type ErrorStateOptions

type ErrorStateOptions struct {
	// Title heads it; "Something went wrong" when empty.
	Title string
	// Retry labels the button; "Retry" when empty.
	Retry string
}

ErrorStateOptions tune an ErrorState.

type FormError

type FormError struct {
	Message string
	Field   *ui.Handle
}

FormError is a message and its field's handle.

type GaugeOptions

type GaugeOptions struct {
	// Format writes the value; "%.0f" when empty.
	Format string
}

GaugeOptions tune a Gauge.

type LiveDotOptions

type LiveDotOptions struct {
	// Text follows the dot; "LIVE" when empty.
	Text string
}

LiveDotOptions tune a LiveDot.

type LoadingVeilOptions

type LoadingVeilOptions struct {
	// Label names the spinner; "Loading" when empty.
	Label string
}

LoadingVeilOptions tune a LoadingVeil.

type MaintenanceOptions

type MaintenanceOptions struct {
	Title, Text string
}

MaintenanceOptions tune a Maintenance; empty copy reads English.

type NotFoundOptions

type NotFoundOptions struct {
	// Code, Title, Text and Home default to English 404 copy.
	Code, Title, Text, Home string
}

NotFoundOptions tune a NotFound.

type OfflineStateOptions

type OfflineStateOptions struct {
	Title, Text, Retry string
}

OfflineStateOptions tune an OfflineState; empty copy reads English.

type ProgressRingOptions

type ProgressRingOptions struct {
	// Format writes the percent; "%.0f%%" when empty.
	Format string
}

ProgressRingOptions tune a ProgressRing.

type QuotaBarOptions

type QuotaBarOptions struct {
	// Format writes used and limit; "%.0f of %.0f" when empty.
	Format string
}

QuotaBarOptions tune a QuotaBar.

type RetryInOptions

type RetryInOptions struct {
	// Wait writes seconds left; "Retry in %d s".
	Wait string
	// Retry labels the enabled button; "Retry" when empty.
	Retry string
}

RetryInOptions tune a RetryIn.

type SaveStatusOptions

type SaveStatusOptions struct {
	Saving, Saved string
}

SaveStatusOptions tune a SaveStatus; empty copy reads English.

type Service

type Service struct {
	Name   string
	State  ServiceState
	Uptime float64
}

Service is a name, state and uptime, 0 to 1.

type ServiceState

type ServiceState uint8

ServiceState is operational, degraded or down.

const (
	Operational ServiceState = iota
	Degraded
	Down
)

The three service states.

type ServiceStatusOptions

type ServiceStatusOptions struct {
	// States name the three states; English when zero.
	States [3]string
	// Uptime writes the uptime percent; "%.2f%%" when empty.
	Uptime string
}

ServiceStatusOptions tune a ServiceStatus.

type SpinOptions

type SpinOptions struct {
	// Size picks small, medium or large; medium when zero.
	Size SpinSize
}

SpinOptions tune a Spin.

type SpinSize

type SpinSize uint8

SpinSize is a Spin's size step.

const (
	SpinMedium SpinSize = iota
	SpinSmall
	SpinLarge
)

The three Spin sizes.

type StepCountOptions

type StepCountOptions struct {
	// Format writes step and total; "Step %d of %d".
	Format string
}

StepCountOptions tune a StepCount.

type StorageBarOptions

type StorageBarOptions struct {
	// Format writes each part's size; "%.0f GB" when empty.
	Format string
}

StorageBarOptions tune a StorageBar.

type StoragePart

type StoragePart struct {
	Name  string
	Size  float64
	Color ui.Color
}

StoragePart is a named share in the caller's color.

type StrengthOptions

type StrengthOptions struct {
	// Words name scores 1 to 4; Weak to Strong.
	Words [4]string
}

StrengthOptions tune a Strength.

type SyncState

type SyncState uint8

SyncState is synced, syncing or failed.

const (
	Synced SyncState = iota
	Syncing
	SyncFailed
)

The three sync states.

type SyncStatusOptions

type SyncStatusOptions struct {
	Synced, Syncing, Failed string
}

SyncStatusOptions tune a SyncStatus; empty copy reads English.

type ToastCardOptions

type ToastCardOptions struct {
	// Action labels an optional action button.
	Action string
	// Close names the close button; "Close" when empty.
	Close string
}

ToastCardOptions tune a ToastCard.

type ToasterOptions

type ToasterOptions struct {
	// Close names each close button; "Close" when empty.
	Close string
}

ToasterOptions tune a Toaster.

type Tone

type Tone uint8

Tone is a message's kind.

const (
	ToneInfo Tone = iota
	ToneSuccess
	ToneWarning
	ToneDanger
)

The four tones.

type UndoToastOptions

type UndoToastOptions struct {
	// Undo labels the button; "Undo" when empty.
	Undo string
	// Close names the close button; "Close" when empty.
	Close string
	// For is how long it shows; 5 s when zero.
	For time.Duration
}

UndoToastOptions tune an UndoToast.

type Upload

type Upload struct {
	Name     string
	Progress float64
}

Upload is a file name and progress, 0 to 1.

Jump to

Keyboard shortcuts

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