Documentation
¶
Overview ¶
Package feedback holds alerts, progress, loaders and states.
Index ¶
- func Alert(c *ui.Context, tone Tone, title, body string) ui.Element
- func AnnouncementBar(c *ui.Context, messages []string, o AnnouncementBarOptions) ui.Element
- func Attention(c *ui.Context, on bool, content func()) ui.Element
- func Banner(c *ui.Context, message, action string, open *bool, o BannerOptions) (root, act ui.Element)
- func BarsLoader(c *ui.Context, label string) ui.Element
- func Battery(c *ui.Context, label string, level float64, charging bool) ui.Element
- func Beacon(c *ui.Context, label, tip string) ui.Element
- func Busy(c *ui.Context, busy bool, working, done string) ui.Element
- func Callout(c *ui.Context, tone Tone, title string, content func()) ui.Element
- func ConnectionStatus(c *ui.Context, state Connection, o ConnectionStatusOptions) ui.Element
- func DismissibleAlert(c *ui.Context, tone Tone, title, body string, open *bool, ...) ui.Element
- func DotsLoader(c *ui.Context, label string) ui.Element
- func EmptyState(c *ui.Context, glyph, title, text, action string) (root, act ui.Element)
- func ErrorList(c *ui.Context, errors []FormError, o ErrorListOptions) ui.Element
- func ErrorState(c *ui.Context, message string, o ErrorStateOptions) (root, retry ui.Element)
- func FieldError(c *ui.Context, message string) ui.Element
- func Gauge(c *ui.Context, label string, value, lo, hi float64, o GaugeOptions) ui.Element
- func Hint(c *ui.Context, text string) ui.Element
- func IndeterminateBar(c *ui.Context, label string) ui.Element
- func InlineMessage(c *ui.Context, tone Tone, text string) ui.Element
- func LevelMeter(c *ui.Context, label string, level float64) ui.Element
- func LiveDot(c *ui.Context, o LiveDotOptions) ui.Element
- func LoadingVeil(c *ui.Context, loading bool, o LoadingVeilOptions, content func()) ui.Element
- func Maintenance(c *ui.Context, o MaintenanceOptions) ui.Element
- func NotFound(c *ui.Context, o NotFoundOptions) (root, home ui.Element)
- func Notice(c *ui.Context, glyph, title, body string) ui.Element
- func OfflineState(c *ui.Context, o OfflineStateOptions) (root, retry ui.Element)
- func OrbitLoader(c *ui.Context, label string) ui.Element
- func ProgressBar(c *ui.Context, label string, value float64) ui.Element
- func ProgressRing(c *ui.Context, label string, value float64, o ProgressRingOptions) ui.Element
- func PulseLoader(c *ui.Context, label string) ui.Element
- func QuotaBar(c *ui.Context, label string, used, limit float64, o QuotaBarOptions) ui.Element
- func RetryIn(c *ui.Context, at time.Time, o RetryInOptions) ui.Element
- func SaveStatus(c *ui.Context, saving bool, o SaveStatusOptions) ui.Element
- func SegmentProgress(c *ui.Context, label string, n, done int) ui.Element
- func ServiceStatus(c *ui.Context, services []Service, o ServiceStatusOptions) ui.Element
- func Signal(c *ui.Context, label string, strength int) ui.Element
- func Skeleton(c *ui.Context) ui.Element
- func SkeletonCard(c *ui.Context) ui.Element
- func SkeletonList(c *ui.Context, rows int) ui.Element
- func SkeletonText(c *ui.Context, lines int) ui.Element
- func Snackbar(c *ui.Context, message, action string, open *bool) (root, act ui.Element)
- func Spin(c *ui.Context, label string, o SpinOptions) ui.Element
- func StepCount(c *ui.Context, step, total int, o StepCountOptions) ui.Element
- func StorageBar(c *ui.Context, label string, parts []StoragePart, total float64, ...) ui.Element
- func Strength(c *ui.Context, label string, score int, o StrengthOptions) ui.Element
- func StripedProgress(c *ui.Context, label string, value float64) ui.Element
- func SuccessState(c *ui.Context, title, text, action string) (root, act ui.Element)
- func SyncStatus(c *ui.Context, state SyncState, o SyncStatusOptions) ui.Element
- func TimeLeftBar(c *ui.Context, label string, ends time.Time, total time.Duration) ui.Element
- func ToastCard(c *ui.Context, tone Tone, title, body string, o ToastCardOptions) (root, act, dismiss ui.Element)
- func Toaster(c *ui.Context, o ToasterOptions) ui.Element
- func UndoToast(c *ui.Context, message string, open *bool, o UndoToastOptions) (root, undo ui.Element)
- func UnlockToast(c *ui.Context, title, text string, open *bool) ui.Element
- func UploadProgress(c *ui.Context, uploads []Upload) ui.Element
- type AnnouncementBarOptions
- type BannerOptions
- type Connection
- type ConnectionStatusOptions
- type DismissibleAlertOptions
- type ErrorListOptions
- type ErrorStateOptions
- type FormError
- type GaugeOptions
- type LiveDotOptions
- type LoadingVeilOptions
- type MaintenanceOptions
- type NotFoundOptions
- type OfflineStateOptions
- type ProgressRingOptions
- type QuotaBarOptions
- type RetryInOptions
- type SaveStatusOptions
- type Service
- type ServiceState
- type ServiceStatusOptions
- type SpinOptions
- type SpinSize
- type StepCountOptions
- type StorageBarOptions
- type StoragePart
- type StrengthOptions
- type SyncState
- type SyncStatusOptions
- type ToastCardOptions
- type ToasterOptions
- type Tone
- type UndoToastOptions
- type Upload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnnouncementBar ¶
AnnouncementBar slides messages up in turn; Changed marks rotations.
func Banner ¶
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 ¶
BarsLoader is equalizer bars rising and falling.
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 ¶
DotsLoader is three dots bouncing in turn.
func EmptyState ¶
EmptyState is icon, title, text and action rising in.
func ErrorState ¶
ErrorState is a shaking error icon, message and Retry.
func FieldError ¶
FieldError is error text that shakes in; empty shows nothing.
func IndeterminateBar ¶
IndeterminateBar is a segment sliding along a track.
func InlineMessage ¶
InlineMessage is tone icon and text fading in.
func LevelMeter ¶
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 ¶
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 OfflineState ¶
func OfflineState(c *ui.Context, o OfflineStateOptions) (root, retry ui.Element)
OfflineState is a pulsing offline icon, message and Retry.
func OrbitLoader ¶
OrbitLoader is a dot orbiting a ring.
func ProgressBar ¶
ProgressBar is a bar whose fill eases to the value.
func ProgressRing ¶
ProgressRing is a circle whose arc draws to the value.
func PulseLoader ¶
PulseLoader is a circle sending rings outward.
func SaveStatus ¶
SaveStatus cross-fades a saving spinner to a saved check.
func SegmentProgress ¶
SegmentProgress is n segments filling in order.
func ServiceStatus ¶
ServiceStatus is service rows with status dots and uptime.
func SkeletonCard ¶
SkeletonCard is a sheen image block, title and lines.
func SkeletonList ¶
SkeletonList is rows of a sheen avatar and two lines.
func SkeletonText ¶
SkeletonText is n sheen lines, the last one shorter.
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 StripedProgress ¶
StripedProgress is a bar whose fill carries moving stripes.
func SuccessState ¶
SuccessState is a drawing check, title and action.
func SyncStatus ¶
SyncStatus is a sync icon and text; syncing spins.
func TimeLeftBar ¶
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 ¶
UnlockToast is an achievement toast with a shine passing once.
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 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 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 ¶
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 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.
Source Files
¶
- alert.go
- announcement_bar.go
- attention.go
- banner.go
- bars_loader.go
- battery.go
- beacon.go
- busy.go
- callout.go
- connection_status.go
- dismissible_alert.go
- dots_loader.go
- empty_state.go
- error_list.go
- error_state.go
- field_error.go
- gauge.go
- helpers.go
- hint.go
- indeterminate_bar.go
- inline_message.go
- level_meter.go
- live_dot.go
- loading_veil.go
- maintenance.go
- not_found.go
- notice.go
- offline_state.go
- orbit_loader.go
- progress_bar.go
- progress_ring.go
- pulse_loader.go
- quota_bar.go
- retry_in.go
- save_status.go
- segment_progress.go
- service_status.go
- signal.go
- skeleton.go
- skeleton_card.go
- skeleton_list.go
- skeleton_text.go
- snackbar.go
- spin.go
- step_count.go
- storage_bar.go
- strength.go
- striped_progress.go
- success_state.go
- sync_status.go
- time_left_bar.go
- toast_card.go
- toaster.go
- undo_toast.go
- unlock_toast.go
- upload_progress.go