mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-17 10:35:28 -07:00
examples/README.md GIFs (#470)
* docs(examples): Add `examples/README.md` Adds `examples/README.md` with GIFs of examples * docs(examples): Individual READMEs * docs(examples): add short description to each example
This commit is contained in:
3
examples/composable-views/README.md
Normal file
3
examples/composable-views/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Composable Views
|
||||
|
||||
<img width="800" src="https://stuff.charm.sh/bubbletea-examples/composable-views.gif" />
|
||||
@@ -44,10 +44,14 @@ var (
|
||||
spinner.Monkey,
|
||||
}
|
||||
modelStyle = lipgloss.NewStyle().
|
||||
Padding(1, 2).
|
||||
Width(15).
|
||||
Height(5).
|
||||
Align(lipgloss.Center, lipgloss.Center).
|
||||
BorderStyle(lipgloss.HiddenBorder())
|
||||
focusedModelStyle = lipgloss.NewStyle().
|
||||
Padding(1, 2).
|
||||
Width(15).
|
||||
Height(5).
|
||||
Align(lipgloss.Center, lipgloss.Center).
|
||||
BorderStyle(lipgloss.NormalBorder()).
|
||||
BorderForeground(lipgloss.Color("69"))
|
||||
spinnerStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("69"))
|
||||
@@ -124,7 +128,7 @@ func (m mainModel) View() string {
|
||||
} else {
|
||||
s += lipgloss.JoinHorizontal(lipgloss.Top, modelStyle.Render(fmt.Sprintf("%4s", m.timer.View())), focusedModelStyle.Render(m.spinner.View()))
|
||||
}
|
||||
s += helpStyle.Render(fmt.Sprintf("\ntab: change focused model • n: new %s • q: exit\n", model))
|
||||
s += helpStyle.Render(fmt.Sprintf("\ntab: focus next • n: new %s • q: exit\n", model))
|
||||
return s
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user