mizchi/tui/headless does not have a README file

    AccordionState

    pub(all) struct AccordionState {
    expanded_ids : Array[String]
    allow_multiple : Bool
    }

    Accordion panel state

    AccordionState::is_expanded

    fn AccordionState::is_expanded(self : AccordionState, id : String) -> Bool

    Check if a panel is expanded

    AccordionState::new

    fn AccordionState::new(allow_multiple? : Bool) -> AccordionState

    Create accordion state

    AccordionState::toggle

    fn AccordionState::toggle(self : AccordionState, id : String) -> AccordionState

    Toggle a panel's expanded state

    ButtonState

    pub(all) enum ButtonState {
    Default
    Hovered
    Focused
    Pressed
    Disabled
    } derive(Eq,
    Debug
    )

    Button state enum
    impl Show for ButtonState

    ButtonState::is_interactive

    fn ButtonState::is_interactive(self : ButtonState) -> Bool

    Check if button is interactive

    FocusNav

    pub(all) struct FocusNav {
    ids : Array[String]
    current_index : Int
    }

    Focus navigation helper for keyboard navigation

    FocusNav::current

    fn FocusNav::current(self : FocusNav) -> String

    Get current focused ID

    FocusNav::focus_id

    fn FocusNav::focus_id(self : FocusNav, id : String) -> FocusNav

    Focus specific ID

    FocusNav::is_focused

    fn FocusNav::is_focused(self : FocusNav, id : String) -> Bool

    Check if ID is focused

    FocusNav::new

    fn FocusNav::new(ids : Array[String]) -> FocusNav

    Create focus navigation

    FocusNav::next

    fn FocusNav::next(self : FocusNav) -> FocusNav

    Move focus to next item

    FocusNav::prev

    fn FocusNav::prev(self : FocusNav) -> FocusNav

    Move focus to previous item

    GridSelectState

    pub(all) struct GridSelectState {
    columns : Int
    selected : Int
    total : Int
    }

    2D grid selection state

    GridSelectState::move_down

    Move selection down

    GridSelectState::move_left

    Move selection left

    GridSelectState::move_right

    Move selection right

    GridSelectState::move_up

    Move selection up

    GridSelectState::new

    fn GridSelectState::new(columns : Int, total : Int, selected? : Int) -> GridSelectState

    Create a new grid select state

    GridSelectState::position

    fn GridSelectState::position(self : GridSelectState) -> (Int, Int)

    Get row and column of current selection

    InputState

    pub(all) enum InputState {
    Idle
    Focused
    Editing
    Disabled
    }

    Input field state

    InputState::is_editable

    fn InputState::is_editable(self : InputState) -> Bool

    Check if input is editable

    InputState::is_focusable

    fn InputState::is_focusable(self : InputState) -> Bool

    Check if input can receive focus

    ModalState

    pub(all) struct ModalState {
    open : Bool
    focused_element : String
    }

    Modal dialog state

    ModalState::hide

    fn ModalState::hide(self : ModalState) -> ModalState

    Close the modal

    ModalState::is_open

    fn ModalState::is_open(self : ModalState) -> Bool

    Check if modal is open

    ModalState::new

    fn ModalState::new() -> ModalState

    Create closed modal state

    ModalState::show

    fn ModalState::show(self : ModalState) -> ModalState

    Open the modal

    SelectionState

    pub(all) struct SelectionState {
    selected_id : String
    focused_id : String
    open : Bool
    }

    Selection state for single-select components

    SelectionState::focus

    fn SelectionState::focus(self : SelectionState, id : String) -> SelectionState

    Focus an item (for keyboard navigation)

    SelectionState::new

    fn SelectionState::new(selected_id? : String) -> SelectionState

    Create default selection state

    SelectionState::select

    fn SelectionState::select(self : SelectionState, id : String) -> SelectionState

    Select an item

    SelectionState::toggle_open

    fn SelectionState::toggle_open(self : SelectionState) -> SelectionState

    Toggle open state (for dropdown-style components)

    ToastLevel

    pub(all) enum ToastLevel {
    Info
    Success
    Warning
    Error
    }

    Toast notification severity level

    ToastState

    pub(all) struct ToastState {
    message : String
    level : ToastLevel
    visible : Bool
    }

    Toast notification state

    ToastState::dismiss

    fn ToastState::dismiss(self : ToastState) -> ToastState

    Dismiss the toast

    ToastState::new

    fn ToastState::new(message : String, level? : ToastLevel) -> ToastState

    Create a new toast state

    ToggleState

    pub(all) struct ToggleState {
    checked : Bool
    focused : Bool
    disabled : Bool
    }

    Toggle state for checkbox/switch

    ToggleState::new

    fn ToggleState::new(checked? : Bool) -> ToggleState

    Create default toggle state

    ToggleState::set_focused

    fn ToggleState::set_focused(self : ToggleState, focused : Bool) -> ToggleState

    Set focus state

    ToggleState::toggle

    fn ToggleState::toggle(self : ToggleState) -> ToggleState

    Toggle the checked state

    TreeState

    pub(all) struct TreeState {
    expanded_ids : Array[String]
    selected_id : String
    focused_id : String
    }

    Tree view state

    TreeState::focus

    fn TreeState::focus(self : TreeState, id : String) -> TreeState

    Focus a node

    TreeState::is_expanded

    fn TreeState::is_expanded(self : TreeState, id : String) -> Bool

    Check if a node is expanded

    TreeState::new

    fn TreeState::new() -> TreeState

    Create a new tree state

    TreeState::select

    fn TreeState::select(self : TreeState, id : String) -> TreeState

    Select a node

    TreeState::toggle_expand

    fn TreeState::toggle_expand(self : TreeState, id : String) -> TreeState

    Toggle expand/collapse for a node

    resolve_button_state

    fn resolve_button_state(id : String, hover_id : String, focus? : FocusNav?, disabled? : Bool) -> ButtonState

    Resolve button state from hover_id and optional FocusNav

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io