(v2) Composing tea.Models
#1540
-
|
Hello! I am updating a project that uses tea/lipgloss etc. (tea @ v2.0.0-beta.6 and lipgloss @ v2.0.0-beta.3 and bubbles @ v2.0.0-beta.1.0....). I might have an incorrect paradigm, but I have a With both of them returning the new For now I'll probably move implementation from the Right model into my central model until I get further coaching here. That said, I await when 2.0.0 is out on all 3 libraries! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
Couple of things:
With the new Suggestions:
For an example of 2 (not quite exactly the same, but gets the idea across), see https://github.com/charmbracelet/bubbletea/blob/v2-exp/examples/canvas/main.go Also worth noting that |
Beta Was this translation helpful? Give feedback.
Couple of things:
tea.Layeris an interface which represents something which can be rendered onto a screen -- it's abstract for high-performance usecases.lipgloss.Layeris designed to be used withlipgloss.NewCanvas(), which creates multi-layer layouts using multiplelipgloss.Layer's, stacked on top of each other, side by side, etc.lipgloss.Canvasimplementstea.Layer.With the new
tea.Viewfunctionality (andtea.Modelbeing updated to usetea.View), the idea now is that this is for the root model only. You can decide on how your children components should be rendered, but it probably shouldn't be throughtea.View/tea.Model, because it has a bunch of stuff that components should proba…