mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 13:06:00 +03:00
[GH-ISSUE #577] feat: Add focusable option to Box #157
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#157
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @eitanalka on GitHub (Jan 23, 2026).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/577
Summary
Add a
focusableoption to Box so it can be made focusable (default false). This enables the existingfocusedBorderColorfeature to actually work.Motivation
Currently, Box has a
focusedBorderColoroption but Box cannot be focused, making this option useless. Addingfocusableallows users to opt-in to focus behavior.Proposed Changes
focusablesetter toRenderablefor dynamic prop updatesfocusableoption toBoxOptions(default false)focusedprop toBoxProps(React/Solid) for controlled focus stateUsage
Behavior
new Box({})new Box({ focusable: true })new Box({ focusable: true, focusedBorderColor: "blue" })<Box focusable /><Box focusable focused={signal()} />Implementation
I have a working implementation with tests ready:
@kommander commented on GitHub (Jan 24, 2026):
yep, also makes sense 👍
@eitanalka commented on GitHub (Jan 25, 2026):
Thank you. Opened a PR for this one as well.
@kommander commented on GitHub (Jan 26, 2026):
This should be fixed with #585