Documentation
¶
Index ¶
- Constants
- Variables
- func DispatchEvent(root Component, ctx cell.Context, ev *driver.Event) bool
- func Run(appFn func(f *Frame, ev *Event) bool, opts ...AppOption) error
- func RuneWidth(r rune) int
- func Start(drawFn func(f *Frame)) error
- func StringWidth(text string) int
- func Wakeup()
- type AlignItems
- type Alignment
- type AppOption
- type Backend
- type Block
- type BorderEdges
- type BorderSymbols
- type Buffer
- type Cell
- type Checkbox
- type Color
- type ColorType
- type Component
- func AlignComponent(child Component, h HAlign, v VAlign) Component
- func AsComponent(w widgets.Widget) Component
- func Border(child Component, symbols widgets.BorderSymbols, style Style) Component
- func BorderCustom(child Component, symbols widgets.BorderSymbols, style Style, edges BorderEdges) Component
- func BottomBorder(child Component, symbol rune, style Style) Component
- func Center(child Component) Component
- func Constrain(minW, maxW, minH, maxH uint16, child Component) Component
- func Divider(style ...Style) Component
- func DividerWithTitle(title string, symbols widgets.BorderSymbols, style Style) Component
- func Dynamic(supplier func() Component) Component
- func Empty() Component
- func FixedSize(width, height uint16, child Component) Component
- func Flex(weight uint16, child Component) Component
- func ForEach[T any](items []T, fn func(item T, index int) Component) []Component
- func Inline(child Component) Component
- func Label(content string, style ...Style) Component
- func Lowercase(child Component) Component
- func Margin(child Component, top, right, bottom, left uint16) Component
- func MarginAll(child Component, m uint16) Component
- func MarginAxis(child Component, horizontal, vertical uint16) Component
- func Mask(child Component, mask rune) Component
- func Match[T comparable](value T, cases map[T]Component, defaultCase ...Component) Component
- func MaxHeight(maxH uint16, child Component) Component
- func MaxWidth(maxW uint16, child Component) Component
- func MinHeight(minH uint16, child Component) Component
- func MinWidth(minW uint16, child Component) Component
- func Overlay(base, overlay Component, x, y uint16) Component
- func Pad(child Component, top, right, bottom, left uint16) Component
- func PadAll(child Component, padding uint16) Component
- func PadAxis(child Component, horizontal, vertical uint16) Component
- func Place(width, height uint16, hAlign HAlign, vAlign VAlign, child Component) Component
- func Spacer(weight ...uint16) Component
- func TextFn(getter func() string, style ...Style) Component
- func TextRef(ptr *string, style ...Style) Component
- func TopBorder(child Component, symbol rune, style Style) Component
- func Transform(child Component, fn func(rune) rune) Component
- func Uppercase(child Component) Component
- func VDivider(style ...Style) Component
- func When(condition bool, then Component, otherwise ...Component) Component
- func WithBackground(color Color, child Component) Component
- func WithForeground(color Color, child Component) Component
- func WithStyle(style Style, child Component) Component
- type Constraint
- type Context
- type Dialog
- type Direction
- type Driver
- type Event
- type EventType
- type FlexLayout
- type Frame
- type HAlign
- type Insets
- type InteractiveComponent
- func OnClick(child Component, handler func(ev MouseEvent)) InteractiveComponent
- func OnEvent(child Component, handler func(ctx cell.Context, ev *driver.Event) bool) InteractiveComponent
- func OnKey(child Component, key driver.KeyType, handler func(ev driver.KeyEvent) bool) InteractiveComponent
- func OnRune(child Component, r rune, handler func(ev driver.KeyEvent) bool) InteractiveComponent
- type JustifyContent
- type KeyEvent
- type KeyType
- type Layout
- type LayoutProps
- type Line
- type List
- type ListState
- type Markdown
- type Modifier
- type MouseButton
- type MouseEvent
- type Paragraph
- type Point
- type ProgressBar
- type RadioButton
- type Rect
- type Select
- type SelectState
- type Slider
- type SliderState
- type Span
- type StackLayout
- type Style
- type Table
- type TableCell
- type TableConstraint
- type TableRow
- type TableState
- type Terminal
- type Text
- type TextAlignment
- type TextArea
- type TextAreaState
- type TextInput
- type TextInputState
- type VAlign
- type Widget
- type ZStackLayout
Constants ¶
const ( HAlignLeft = component.AlignLeft HAlignCenter = component.AlignCenter HAlignRight = component.AlignRight AlignTop = component.AlignTop AlignMiddle = component.AlignMiddle AlignBottom = component.AlignBottom )
const ( JustifyStart = component.JustifyStart JustifyCenter = component.JustifyCenter JustifyEnd = component.JustifyEnd JustifySpaceBetween = component.JustifySpaceBetween JustifySpaceAround = component.JustifySpaceAround JustifySpaceEvenly = component.JustifySpaceEvenly )
const ( AlignItemsStretch = component.AlignItemsStretch AlignItemsStart = component.AlignItemsStart AlignItemsCenter = component.AlignItemsCenter AlignItemsEnd = component.AlignItemsEnd )
const ( BorderEdgeTop = component.BorderEdgeTop BorderEdgeRight = component.BorderEdgeRight BorderEdgeBottom = component.BorderEdgeBottom BorderEdgeLeft = component.BorderEdgeLeft BorderEdgeAll = component.BorderEdgeAll BorderEdgeHorizontal = component.BorderEdgeHorizontal BorderEdgeVertical = component.BorderEdgeVertical )
const ( // Direction Horizontal = layout.Horizontal Vertical = layout.Vertical // Alignment AlignLeft = widgets.AlignLeft AlignCenter = widgets.AlignCenter AlignRight = widgets.AlignRight // TextAlignment AlignTextLeft = widgets.AlignTextLeft AlignTextCenter = widgets.AlignTextCenter AlignTextRight = widgets.AlignTextRight // Borders BorderNone = widgets.BorderNone BorderTop = widgets.BorderTop BorderBottom = widgets.BorderBottom BorderLeft = widgets.BorderLeft BorderRight = widgets.BorderRight BorderAll = widgets.BorderAll // Modifiers ModifierReset = cell.ModifierReset ModifierBold = cell.ModifierBold ModifierDim = cell.ModifierDim ModifierItalic = cell.ModifierItalic ModifierUnderline = cell.ModifierUnderline ModifierBlink = cell.ModifierBlink ModifierReverse = cell.ModifierReverse // Event Types EventKey = driver.EventKey EventMouse = driver.EventMouse EventResize = driver.EventResize // Key Types KeyRune = driver.KeyRune KeySpace = driver.KeySpace KeyEnter = driver.KeyEnter KeyBackspace = driver.KeyBackspace KeyDelete = driver.KeyDelete KeyTab = driver.KeyTab KeyEsc = driver.KeyEsc KeyUp = driver.KeyArrowUp KeyDown = driver.KeyArrowDown KeyLeft = driver.KeyArrowLeft KeyRight = driver.KeyArrowRight KeyHome = driver.KeyHome KeyEnd = driver.KeyEnd KeyPageUp = driver.KeyPageUp KeyPageDown = driver.KeyPageDown // Mouse Buttons MouseLeft = driver.MouseLeft MouseMiddle = driver.MouseMiddle MouseRight = driver.MouseRight MouseRelease = driver.MouseRelease MouseScrollUp = driver.MouseScrollUp MouseScrollDown = driver.MouseScrollDown )
Re-exported Constants
Variables ¶
var ( SymbolsSingle = widgets.SymbolsSingle SymbolsDouble = widgets.SymbolsDouble SymbolsThick = widgets.SymbolsThick SymbolsRounded = widgets.SymbolsRounded SymbolsBlock = widgets.SymbolsBlock )
var ( ColorDefault = cell.NewColorDefault() ColorBlack = cell.NewColorANSI(0) ColorRed = cell.NewColorANSI(1) ColorGreen = cell.NewColorANSI(2) ColorYellow = cell.NewColorANSI(3) ColorBlue = cell.NewColorANSI(4) ColorMagenta = cell.NewColorANSI(5) ColorCyan = cell.NewColorANSI(6) ColorWhite = cell.NewColorANSI(7) )
Color Presets
Functions ¶
func DispatchEvent ¶ added in v0.2.0
DispatchEvent routes an event down a component tree starting from root within ctx.Area.
func Run ¶
Run starts an event-driven Limoni application loop. appFn is invoked with the active Frame and the triggering Event. Returning false from appFn cleanly exits the application. On the first invocation, ev is nil for the initial render. By default, Ctrl+C automatically terminates the application gracefully, unless WithCatchCtrlC(true) or WithoutDefaultQuitKeys() is supplied.
func Start ¶
Start displays a static or single-state frame and cleanly exits when 'q', 'ESC', or Ctrl+C is pressed.
func StringWidth ¶
StringWidth returns the terminal display column width of UTF-8 text.
Types ¶
type AlignItems ¶ added in v0.2.0
type AlignItems = component.AlignItems
type AppOption ¶ added in v0.2.0
type AppOption func(*appConfig)
AppOption configures the application lifecycle in Run.
func WithCatchCtrlC ¶ added in v0.2.0
WithCatchCtrlC configures whether Ctrl+C is forwarded to the application as a normal key event instead of automatically terminating the process.
func WithFPS ¶ added in v0.2.3
WithFPS configures a continuous animation frame rate (e.g. 60, 120, 240 FPS). When configured, the render loop continuously invokes the draw function at the target rate.
func WithoutDefaultQuitKeys ¶ added in v0.2.0
func WithoutDefaultQuitKeys() AppOption
WithoutDefaultQuitKeys disables automatic termination on Ctrl+C. When enabled, Ctrl+C is forwarded to the application's event handler.
type BorderEdges ¶ added in v0.2.0
type BorderEdges = component.BorderEdges
BorderEdges specifies which sides of a border to render.
type Color ¶
Re-exported Core Types
type Component ¶ added in v0.2.0
Component is the minimal, unified interface for all composable UI elements.
func AlignComponent ¶ added in v0.2.0
AlignComponent aligns a component within its allocated area according to horizontal and vertical rules.
func AsComponent ¶ added in v0.2.0
AsComponent wraps an existing widgets.Widget to satisfy the Component interface.
func Border ¶ added in v0.2.0
func Border(child Component, symbols widgets.BorderSymbols, style Style) Component
Border wraps any component with a decorative 4-sided border.
func BorderCustom ¶ added in v0.2.0
func BorderCustom(child Component, symbols widgets.BorderSymbols, style Style, edges BorderEdges) Component
BorderCustom wraps any component with selective border edges.
func BottomBorder ¶ added in v0.2.0
BottomBorder wraps a component with a single bottom border rule (e.g. tab underline).
func Center ¶ added in v0.2.0
Center centers a component both horizontally and vertically within its allocated area.
func Constrain ¶ added in v0.2.0
Constrain enforces minimum and maximum width and height bounds on a child component.
func Divider ¶ added in v0.2.0
Divider creates a horizontal rule filling 100% of the available width with 1 row height.
func DividerWithTitle ¶ added in v0.2.0
func DividerWithTitle(title string, symbols widgets.BorderSymbols, style Style) Component
DividerWithTitle creates a horizontal rule with a title centered in the divider.
func Dynamic ¶ added in v0.2.0
Dynamic constructs a reactive component whose child subtree is resolved at render time.
func FixedSize ¶ added in v0.2.0
FixedSize forces a fixed width and height onto a child component. (Named FixedSize to avoid collision with layout.Fixed constraints).
func Flex ¶ added in v0.2.0
Flex sets the expansion weight of a child component inside a StackLayout (VStack / HStack).
func ForEach ¶ added in v0.2.0
ForEach maps a slice of items of type T to a slice of Components using the provided mapping function. The resulting slice can be directly spread into container layouts such as VStack(...) or HStack(...).
func Inline ¶ added in v0.2.0
Inline constrains a component to render on a single line (height = 1). Useful for status bars, breadcrumbs, and inline badges.
func Lowercase ¶ added in v0.2.0
Lowercase wraps a child component and transforms all text to lowercase.
func MarginAxis ¶ added in v0.2.0
MarginAxis adds symmetric horizontal and vertical outer spacing.
func Mask ¶ added in v0.2.0
Mask wraps a child component and replaces all visible text with a mask rune (e.g. '•' for passwords).
func Match ¶ added in v0.2.0
func Match[T comparable](value T, cases map[T]Component, defaultCase ...Component) Component
Match inspects value against cases map and returns the matching component, or defaultCase (or Empty()).
func Overlay ¶ added in v0.2.0
Overlay places an overlay component on top of a base component at absolute position (x, y) within the base's bounding area. Equivalent to Lipgloss's PlaceOverlay(x, y, fg, bg).
func Place ¶ added in v0.2.0
Place positions a child component inside a fixed bounding box of (width x height) aligned horizontally and vertically according to hAlign and vAlign. Equivalent to Lipgloss's lipgloss.Place().
func Spacer ¶ added in v0.2.0
Spacer returns an expanding, invisible flexible component. In an HStack, it expands horizontally pushing adjacent items apart. In a VStack, it expands vertically.
func TextFn ¶ added in v0.2.0
TextFn creates a dynamic text component evaluated via a getter function on each frame.
func TextRef ¶ added in v0.2.0
TextRef creates a dynamic, data-driven text component bound directly to a string variable pointer.
func Transform ¶ added in v0.2.0
Transform wraps a child component and applies fn to every non-zero rune in its bounding area after the child has drawn. Zero-allocation.
func Uppercase ¶ added in v0.2.0
Uppercase wraps a child component and transforms all text to uppercase.
func VDivider ¶ added in v0.2.0
VDivider creates a vertical rule filling 100% of the available height with 1 column width.
func When ¶ added in v0.2.0
When renders then component if condition is true, otherwise the optional otherwise component (or Empty()).
func WithBackground ¶ added in v0.2.0
WithBackground cascades a background color override into the component subtree.
func WithForeground ¶ added in v0.2.0
WithForeground cascades a foreground color override into the component subtree.
type Constraint ¶
type Constraint = layout.Constraint
Re-exported Core Types
func Fill ¶
func Fill() Constraint
Fill creates a constraint that expands to take all remaining available space.
func Percentage ¶
func Percentage(p uint16) Constraint
Percentage creates a percentage-based layout constraint (0-100).
type Context ¶
Re-exported Core Types
func NewContext ¶ added in v0.2.0
NewContext creates a new ephemeral drawing Context for widgets and components.
type InteractiveComponent ¶ added in v0.2.0
type InteractiveComponent = component.InteractiveComponent
InteractiveComponent represents a composable element capable of handling input and mouse events.
func OnClick ¶ added in v0.2.0
func OnClick(child Component, handler func(ev MouseEvent)) InteractiveComponent
OnClick wraps any component with a click handler.
func OnEvent ¶ added in v0.2.0
func OnEvent(child Component, handler func(ctx cell.Context, ev *driver.Event) bool) InteractiveComponent
OnEvent attaches an arbitrary event listener (keyboard, mouse, resize, paste) to a component.
type JustifyContent ¶ added in v0.2.0
type JustifyContent = component.JustifyContent
Composable Flexbox distribution & alignment
type LayoutProps ¶ added in v0.2.0
type LayoutProps = component.LayoutProps
LayoutProps defines sizing and layout constraints for composable negotiation.
type ListState ¶
Re-exported Core Types
func NewListState ¶
func NewListState() *ListState
NewListState creates a new ListState for tracking list item selection and scroll offsets.
type Markdown ¶
Re-exported Core Types
func NewMarkdown ¶
NewMarkdown creates a new Markdown rendering widget.
type Paragraph ¶
Re-exported Core Types
func NewParagraph ¶
NewParagraph creates a new Paragraph widget with word-wrapping enabled.
type Rect ¶
Re-exported Core Types
func SplitHorizontal ¶
func SplitHorizontal(area Rect, constraints ...Constraint) []Rect
SplitHorizontal splits an area horizontally according to constraints.
func SplitVertical ¶
func SplitVertical(area Rect, constraints ...Constraint) []Rect
SplitVertical splits an area vertically according to constraints.
type SelectState ¶
type SelectState = widgets.SelectState
Re-exported Core Types
func NewSelectState ¶
func NewSelectState() *SelectState
NewSelectState creates a new SelectState for dropdown selection.
type SliderState ¶
type SliderState = widgets.SliderState
Re-exported Core Types
func NewSliderState ¶
func NewSliderState(value int) *SliderState
NewSliderState creates a new SliderState with the given initial value.
type StackLayout ¶ added in v0.2.0
type StackLayout = component.StackLayout
StackLayout arranges components linearly along a primary axis.
func HStack ¶ added in v0.2.0
func HStack(children ...Component) *StackLayout
HStack creates a horizontal stack arranging children left-to-right.
func VStack ¶ added in v0.2.0
func VStack(children ...Component) *StackLayout
VStack creates a vertical stack arranging children top-to-bottom.
type Style ¶
Re-exported Core Types
type TableState ¶
type TableState = widgets.TableState
Re-exported Core Types
func NewTableState ¶
func NewTableState() *TableState
NewTableState creates a new TableState for tracking selection, scrolling, and column sizes.
type TextAreaState ¶
type TextAreaState = widgets.TextAreaState
Re-exported Core Types
func NewTextAreaState ¶
func NewTextAreaState() *TextAreaState
NewTextAreaState creates a new TextAreaState for multiline text editing.
type TextInput ¶
Re-exported Core Types
func NewTextInput ¶
NewTextInput creates a single-line interactive TextInput widget with the specified ID.
type TextInputState ¶
type TextInputState = widgets.TextInputState
Re-exported Core Types
func NewTextInputState ¶
func NewTextInputState() *TextInputState
NewTextInputState creates a new TextInputState for managing typed text and cursor position.
type ZStackLayout ¶ added in v0.2.0
type ZStackLayout = component.ZStackLayout
ZStackLayout arranges components in depth layers (Painter's algorithm).
func ZStack ¶ added in v0.2.0
func ZStack(children ...Component) *ZStackLayout
ZStack creates a depth-axis container rendering from background to foreground. All children share the same bounding area without offscreen buffer allocations.
Directories
¶
| Path | Synopsis |
|---|---|
|
runners/compare
command
|
|
|
runners/dashboard
command
|
|
|
runners/limoni
command
|
|
|
cmd
|
|
|
limoni
command
Command limoni, Limoni TUI projeleri için iskelet (scaffold) üretir.
|
Command limoni, Limoni TUI projeleri için iskelet (scaffold) üretir. |
|
compat
|
|
|
core
|
|
|
accessibility
Package accessibility contains semantic UI metadata independent of rendering.
|
Package accessibility contains semantic UI metadata independent of rendering. |
|
engine
Package runtime provides an optional Init/Update/View application runtime.
|
Package runtime provides an optional Init/Update/View application runtime. |
|
examples
|
|
|
3d_viewer
command
|
|
|
animation
command
|
|
|
ascii3d
command
ascii3d demonstrates real-time 3D ASCII & sub-cell rendering in Limoni TUI.
|
ascii3d demonstrates real-time 3D ASCII & sub-cell rendering in Limoni TUI. |
|
charts
command
|
|
|
composable
command
|
|
|
custom_widget
command
|
|
|
dashboard
command
|
|
|
demo
command
Limoni Flagship Interactive Demo Designed with a clean, professional sidebar layout, full mouse click interaction, and studio-quality 3D lemon model rendering.
|
Limoni Flagship Interactive Demo Designed with a clean, professional sidebar layout, full mouse click interaction, and studio-quality 3D lemon model rendering. |
|
forms
command
forms demonstrates the Select and Slider widgets.
|
forms demonstrates the Select and Slider widgets. |
|
layer_demo
command
layer_demo demonstrates Limoni layered rendering capabilities: - Layered Rendering with z-index based compositing - Modal Dialog with Focus Trapping - Popup / Dropdown menus - Click-outside dismissal mechanism
|
layer_demo demonstrates Limoni layered rendering capabilities: - Layered Rendering with z-index based compositing - Modal Dialog with Focus Trapping - Popup / Dropdown menus - Click-outside dismissal mechanism |
|
paint
command
|
|
|
showcase
command
|
|
|
simple
command
|
|
|
ssh_server
command
|
|
|
table_virtual
command
|
|
|
toast
command
|
|
|
todo
command
|
|
|
treeview
command
|
|
|
wasm
command
|
|
|
internal
|
|
|
tools/widgetdocs
command
Command widgetdocs, widgets paketindeki kaynak koddan docs/widget-gallery.md dosyasını üretir.
|
Command widgetdocs, widgets paketindeki kaynak koddan docs/widget-gallery.md dosyasını üretir. |
|
Package testkit provides deterministic, terminal-independent helpers for testing Limoni widgets and frames.
|
Package testkit provides deterministic, terminal-independent helpers for testing Limoni widgets and frames. |