Skip to content

docs: add missing Box component properties and tests#1189

Open
karan74jaiswal wants to merge 3 commits into
anomalyco:mainfrom
karan74jaiswal:docs-and-tests-box-props
Open

docs: add missing Box component properties and tests#1189
karan74jaiswal wants to merge 3 commits into
anomalyco:mainfrom
karan74jaiswal:docs-and-tests-box-props

Conversation

@karan74jaiswal

Copy link
Copy Markdown

What this PR does:
This PR updates the Box component documentation to accurately reflect the available BoxOptions API in packages/core/src/renderables/Box.ts. It also adds behavioral test coverage for these previously undocumented properties.

While using opentui, I noticed that the online documentation for the Box component was missing several functional properties (such as single-sided borders, focus colors, and layout gaps).

Changes made:

  • Docs: Added explicit code examples to box.mdx for custom border characters (BorderCharacters), single-sided borders (BorderSides), layout gaps (rowGap, columnGap), and focusable states.
  • Docs: Formatted the properties table to perfectly match the alignment and strict TypeScript typings of other component documentation files (like input.mdx and text.mdx).
  • Tests: Added comprehensive, use-case-driven tests in Box.test.ts for shouldFill, customBorderChars, focusedBorderColor, and flex gaps to ensure there are no regressions.

Testing:

  • All 33 tests in Box.test.ts pass successfully.
  • Ran bun run validate:docs, and the documentation structure, links, and code examples passed flawlessly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant