Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct { // Total width of the progress bar, including percentage, if set. Width int // "Filled" sections of the progress bar Full rune FullColor string // "Empty" sections of progress bar Empty rune EmptyColor string // Settings for rendering the numeric percentage ShowPercentage bool PercentFormat string // a fmt string for a float PercentageStyle *termenv.Style // contains filtered or unexported fields }
Model stores values we'll use when rendering the progress bar.
type Option ¶
Option is used to set options in NewModel. For example:
progress := NewModel( WithRamp("#ff0000", "#0000ff"), WithoutPercentage(), )
func WithDefaultGradient ¶
func WithDefaultGradient() Option
WithDefaultGradient sets a gradient fill with default colors.
func WithDefaultScaledGradient ¶
func WithDefaultScaledGradient() Option
WithDefaultScaledGradient sets a gradient with default colors, and scales the gradient to fit the filled portion of the ramp.
func WithGradient ¶
WithGradient sets a gradient fill blending between two colors.
func WithScaledGradient ¶
WithScaledGradient scales the gradient to fit the width of the filled portion of the progress bar.
func WithSolidFill ¶
WithSolidFill sets the progress to use a solid fill with the given color.
func WithWidth ¶
WithWidth sets the initial width of the progress bar. Note that you can also set the width via the Width property, which can come in handy if you're waiting for a tea.WindowSizeMsg.
func WithoutPercentage ¶
func WithoutPercentage() Option
WithoutPercentage hides the numeric percentage.