Sign in

    mizchi/tui/core does not have a README file

    BorderChars

    pub(all) struct BorderChars {
    top_left : Char
    top_right : Char
    bottom_left : Char
    bottom_right : Char
    horizontal : Char
    vertical : Char
    }

    Border characters for box drawing

    BorderChars::ascii

    fn BorderChars::ascii() -> BorderChars

    BorderChars::double

    fn BorderChars::double() -> BorderChars

    BorderChars::rounded

    fn BorderChars::rounded() -> BorderChars

    BorderChars::single

    fn BorderChars::single() -> BorderChars

    ClickHandler

    pub(all) type ClickHandler () -> Unit

    Click handler type for component-level event handling

    ClickHandler::inner

    #deprecated("Use `struct T(A)` to declare a newtype and use `.0` access the underlying type instead.")
    fn ClickHandler::inner(self : ClickHandler) -> (() -> Unit)
    Convert newtype to its underlying type, automatically derived.

    ClickHandler::invoke

    fn ClickHandler::invoke(self : ClickHandler) -> Unit

    Invoke click handler

    ClickHandler::new

    fn ClickHandler::new(handler : () -> Unit) -> ClickHandler

    Create a new click handler

    ClickHandlers

    pub(all) type ClickHandlers Map[String, ClickHandler]

    Click handlers map (component ID -> handler)

    ClickHandlers::get

    fn ClickHandlers::get(self : ClickHandlers, id : String) -> ClickHandler?

    ClickHandlers::inner

    #deprecated("Use `struct T(A)` to declare a newtype and use `.0` access the underlying type instead.")
    fn ClickHandlers::inner(self : ClickHandlers) -> Map[String, ClickHandler]
    Convert newtype to its underlying type, automatically derived.

    ClickHandlers::iter

    fn ClickHandlers::iter(self : ClickHandlers) -> Iter[(String, ClickHandler)]

    ClickHandlers::new

    ClickHandlers::set

    fn ClickHandlers::set(self : ClickHandlers, id : String, handler : ClickHandler) -> Unit

    Color

    pub(all) struct Color {
    r : Int
    g : Int
    b : Int
    a : Double
    }

    TUI Color type (RGBA)
    impl Eq for Color

    Color::black

    fn Color::black() -> Color

    Color::blue

    fn Color::blue() -> Color

    Color::cyan

    fn Color::cyan() -> Color

    Color::from_crater

    Convert from crater Color

    Color::green

    fn Color::green() -> Color

    Color::is_transparent

    fn Color::is_transparent(self : Color) -> Bool

    Color::magenta

    fn Color::magenta() -> Color

    Color::red

    fn Color::red() -> Color

    Color::rgb

    fn Color::rgb(r : Int, g : Int, b : Int) -> Color

    Color::rgba

    fn Color::rgba(r : Int, g : Int, b : Int, a : Double) -> Color

    Color::transparent

    fn Color::transparent() -> Color

    Color::white

    fn Color::white() -> Color

    Color::yellow

    fn Color::yellow() -> Color

    Component

    pub struct Component {
    node :
    Node

    styles : RenderStyleMap
    texts : TextContentMap
    click_handlers : ClickHandlers
    roles : RoleMap
    }

    Component represents a renderable UI element with its layout, style, and content

    RenderStyle

    pub(all) struct RenderStyle {
    fg : Color
    bg : Color
    bold : Bool
    underline : Bool
    border : BorderChars?
    border_fg : Color
    }

    Rendering options for a node

    RenderStyle::default

    fn RenderStyle::default() -> RenderStyle

    RenderStyleMap

    pub type RenderStyleMap Map[String, RenderStyle]

    Map from node ID to render style

    RenderStyleMap::get

    fn RenderStyleMap::get(self : RenderStyleMap, id : String) -> RenderStyle

    RenderStyleMap::inner

    #deprecated("Use `struct T(A)` to declare a newtype and use `.0` access the underlying type instead.")
    fn RenderStyleMap::inner(self : RenderStyleMap) -> Map[String, RenderStyle]
    Convert newtype to its underlying type, automatically derived.

    RenderStyleMap::new

    RenderStyleMap::set

    fn RenderStyleMap::set(self : RenderStyleMap, id : String, style : RenderStyle) -> Unit

    Role

    pub(all) enum Role {
    Button
    Checkbox
    Link
    Menuitem
    Option
    Radio
    Slider
    Switch
    Tab
    Textbox
    Listbox
    Menu
    Menubar
    Radiogroup
    Tablist
    Tree
    Treegrid
    Article
    Cell
    Columnheader
    Definition
    Directory
    Document
    Group
    Heading
    Img
    List
    Listitem
    Row
    Rowgroup
    Rowheader
    Separator
    Table
    Term
    Banner
    Complementary
    Contentinfo
    Form
    Main
    Navigation
    Region
    Search
    Alert
    Log
    Marquee
    Status
    Timer
    Alertdialog
    Dialog
    Custom(String)
    }

    ARIA role for accessibility Based on WAI-ARIA 1.2 roles
    impl Eq for Role
    impl Show for Role

    RoleMap

    pub(all) type RoleMap Map[String, Role]

    Role map (component ID -> role)

    RoleMap::get

    fn RoleMap::get(self : RoleMap, id : String) -> Role?

    RoleMap::inner

    #deprecated("Use `struct T(A)` to declare a newtype and use `.0` access the underlying type instead.")
    fn RoleMap::inner(self : RoleMap) -> Map[String, Role]
    Convert newtype to its underlying type, automatically derived.

    RoleMap::iter

    fn RoleMap::iter(self : RoleMap) -> Iter[(String, Role)]

    RoleMap::new

    fn RoleMap::new() -> RoleMap

    RoleMap::set

    fn RoleMap::set(self : RoleMap, id : String, role : Role) -> Unit

    TextContentMap

    pub type TextContentMap Map[String, String]

    Map from node ID to text content

    TextContentMap::get

    fn TextContentMap::get(self : TextContentMap, id : String) -> String?

    TextContentMap::inner

    #deprecated("Use `struct T(A)` to declare a newtype and use `.0` access the underlying type instead.")
    fn TextContentMap::inner(self : TextContentMap) -> Map[String, String]
    Convert newtype to its underlying type, automatically derived.

    TextContentMap::new

    TextContentMap::set

    fn TextContentMap::set(self : TextContentMap, id : String, text : String) -> Unit

    box

    fn box(children : Array[Component], id? : String, width? :
    Dimension
    , height? :
    Dimension
    , min_width? :
    Dimension
    , min_height? :
    Dimension
    , max_width? :
    Dimension
    , max_height? :
    Dimension
    , flex_grow? : Double, flex_shrink? : Double, flex_basis? :
    Dimension
    , flex_direction? :
    FlexDirection
    , flex_wrap? :
    FlexWrap
    , justify_content? :
    Alignment
    , align_items? :
    Alignment
    , align_content? :
    Alignment
    , gap? : Double, padding? : Double, padding_x? : Double, padding_y? : Double, margin? : Double, margin_x? : Double, margin_y? : Double, position? :
    Position
    , inset_top? :
    Dimension
    , inset_right? :
    Dimension
    , inset_bottom? :
    Dimension
    , inset_left? :
    Dimension
    , border? : BorderChars?, border_color? : Color, bg? : Color, fg? : Color, on_click? : () -> Unit?, role? : Role?) -> Component

    Create a box component

    char_display_width

    fn char_display_width(c : Char) -> Int

    Get display width of a character (1 for normal, 2 for wide/CJK)

    spacer

    fn spacer(flex_grow? : Double) -> Component

    Spacer component - flexible empty space

    string_display_width

    fn string_display_width(s : String) -> Int

    Calculate display width of a string

    styled_text

    fn styled_text(content : String, fg? : Color, bg? : Color, bold? : Bool, underline? : Bool) -> Component

    Create a styled text (alias for text with labeled arguments)

    text

    fn text(content : String, fg? : Color, bg? : Color, bold? : Bool, underline? : Bool) -> Component

    Create a text component

    text_box

    fn text_box(content : String, id? : String, width? :
    Dimension
    , height? :
    Dimension
    , min_width? :
    Dimension
    , min_height? :
    Dimension
    , max_width? :
    Dimension
    , max_height? :
    Dimension
    , flex_grow? : Double, flex_shrink? : Double, flex_basis? :
    Dimension
    , padding? : Double, padding_x? : Double, padding_y? : Double, margin? : Double, margin_x? : Double, margin_y? : Double, border? : BorderChars?, border_color? : Color, bg? : Color, fg? : Color, bold? : Bool, underline? : Bool) -> Component

    Create a box with text content that wraps within the box's bounds Unlike text(), this renders the text directly within the box's layout dimensions

    text_measure_func

    fn text_measure_func(text : String) ->
    MeasureFunc

    Create a MeasureFunc for text that uses character width

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io