Skip to content

interactive-buttons

Keyboard-driven interactive button menus for your Python terminal apps.

  • Three layout modes


    Render buttons as a horizontal row, a vertical column, or a square grid, one method call each.

    Layout examples

  • 12 built-in style presets


    Plug in HACKER_STYLE, CYBERPUNK_STYLE, CORPORATE_STYLE, and nine others with zero configuration.

    Style presets

  • Hotkey bindings


    Assign one or more keys to any button, with optional instant-confirm on press and case-sensitivity control.

    Key binding examples

  • Minimal dependencies


    Relies only on colorama and readchar. Works in any real terminal on Linux, macOS, and Windows.

    Getting started


Installation

pip install interactive-buttons-v2

Quick example

from interactive_buttons import Button, Component, ButtonStyle, HACKER_STYLE

buttons = [
    Button(label="Continue", value="continue"),
    Button(label="Exit",     value="exit"),
]

comp   = Component(buttons, global_buttons_style=ButtonStyle(**HACKER_STYLE))
choice = comp.column_buttons()

print(f"You chose: {choice}")

Use up / down to navigate and Enter to confirm.

> Continue      <- highlighted (selected)
  Exit