feat: Add focusable option to Box#585
Merged
kommander merged 5 commits intoanomalyco:mainfrom Jan 26, 2026
Merged
Conversation
Enable Box to be focused by adding a `focusable` option (default false). When focusable is true, the existing `focusedBorderColor` feature works. Changes: - Add focusable setter to Renderable for dynamic prop updates - Add focusable option to BoxOptions - Add focused prop to BoxProps (React/Solid) for controlled focus Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@opentui/core
@opentui/react
@opentui/solid
@opentui/core-darwin-arm64
@opentui/core-darwin-x64
@opentui/core-linux-arm64
@opentui/core-linux-x64
@opentui/core-win32-arm64
@opentui/core-win32-x64
commit: |
Collaborator
|
@eitanalka I can't push to your branch, so you would have to run |
Contributor
Author
|
@kommander I updated the branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
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()} />