toggle

package module
v0.0.0-...-942f5ed Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: MIT Imports: 3 Imported by: 0

README

Bubble Toggle

A Bubbletea Bubble that acts as a simple switch or checkbox.

Features

  • Set styles and strings for both states
  • Easily Toggle(), Select(), or Deselect() for internal control
  • Lipgloss styling
  • Individual styles for both enabled and disabled states

To Be Implemented

  • Focus()
  • Bubbletea keybinds
  • n-State's (bools are for fools)
  • Mouse Support
  • More intuitive styling

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	SelectedStyle    lipgloss.Style
	UnselectedStyle  lipgloss.Style
	DisabledStyle    lipgloss.Style
	SelectedString   string
	UnselectedString string
	Value            string
	// contains filtered or unexported fields
}

func New

func New() Model

func (*Model) Deselect

func (m *Model) Deselect()

func (*Model) Disable

func (m *Model) Disable()

func (*Model) Enable

func (m *Model) Enable()

func (Model) IsEnabled

func (m Model) IsEnabled() bool

func (Model) IsToggled

func (m Model) IsToggled() bool

func (*Model) Select

func (m *Model) Select()

func (*Model) Toggle

func (m *Model) Toggle()

func (Model) Update

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

func (Model) View

func (m Model) View() string

Jump to

Keyboard shortcuts

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