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.
-
12 built-in style presets
Plug in
HACKER_STYLE,CYBERPUNK_STYLE,CORPORATE_STYLE, and nine others with zero configuration. -
Hotkey bindings
Assign one or more keys to any button, with optional instant-confirm on press and case-sensitivity control.
-
Minimal dependencies
Relies only on
coloramaandreadchar. Works in any real terminal on Linux, macOS, and Windows.
Installation¶
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.