anim

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright 2026 Teradata

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Package anim provides animation components (stub).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Anim

type Anim = Model

Anim is an alias for Model (for compatibility).

type Model

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

Model is an animation component.

func New

func New(s ...Settings) *Model

New creates a new animation with settings.

func Spinner

func Spinner() *Model

Spinner creates a spinner animation.

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init initializes the animation.

func (*Model) Running

func (m *Model) Running() bool

Running returns whether the animation is running.

func (*Model) SetLabel

func (m *Model) SetLabel(label string)

SetLabel sets a label for the animation.

func (*Model) SetStyle

func (m *Model) SetStyle(s lipgloss.Style)

SetStyle sets the style.

func (*Model) Start

func (m *Model) Start() tea.Cmd

Start starts the animation.

func (*Model) Stop

func (m *Model) Stop()

Stop stops the animation.

func (*Model) Tick

func (m *Model) Tick()

Tick advances the animation.

func (*Model) Update

func (m *Model) Update(msg tea.Msg) (util.Model, tea.Cmd)

Update handles messages.

func (*Model) View

func (m *Model) View() string

View renders the animation.

type Settings

type Settings struct {
	Size        int
	GradColorA  color.Color
	GradColorB  color.Color
	CycleColors bool
	Label       string
	LabelColor  color.Color
}

Settings configures an animation.

type StepMsg

type StepMsg struct {
	Time time.Time
}

StepMsg is sent when an animation step occurs.

Jump to

Keyboard shortcuts

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