Skip to content

Latest commit

 

History

History
56 lines (38 loc) · 1.17 KB

README.md

File metadata and controls

56 lines (38 loc) · 1.17 KB

Marquee Bubble

GoDoc

A simple BubbleTea bubble component to generate marquees.

Made with VHS

Usage

First, initialize a new marquee, then set the text to display, and optionally the width. If width is not defined, it's assumed from the text's length.

func NewMyModel() MyModel {
    m := marquee.New()
    m.SetText("Hello World")
    m.SetWidth(100) // optional
    return MyModel{marquee: m}
}

It supports two scrolling directions, left and right.

m.ScrollDirection = marquee.Right

You can also specify the scrolling speed (defaults to 250ms).

m.ScrollSpeed = 50 * time.Millisecond

And you can make it continuous:

m.SetContinuous(true)

Then, call scroll in your Init().

func(m MyModel) Init() tea.Cmd {
  return m.marquee.Scroll
}

That's it. Check the documentation and the example directory for more detailed usage.

License

See LICENSE.