gpui-component
gpui-component copied to clipboard
empty: Add Empty component
Description
Add Empty component
Problem: There was no built‑in empty‑state placeholder component to use when content areas are empty (e.g., no search results, no items). Developers had to assemble such layouts manually.
Solution:
- Introduced
Empty, a composable empty‑state container supporting an optional icon, title, description, and action button. - Added a story for the gallery showing minimal and full usage examples.
- Added unit tests ensuring the component creates correctly with and without full configuration.
- Created a documentation page matching the style of existing component docs.
- Fixed duplicate module/import entries caused by the initial scripted insertion.
- Removed an unused
h_fleximport to keep the codebase clean.
All changes are additive and non‑breaking.
Screenshot
| Before | After |
|---|---|
| [Put Before Screenshot here] |
Break Changes
None.
How to Test
Ran doc story and test
Checklist
- [x] I have read the CONTRIBUTING document and followed the guidelines.
- [x] Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate.
- [x] Passed
cargo runfor story tests related to the changes. - [ ] Tested macOS, Windows and Linux platforms performance (if the change is platform-specific)
Please follow the Shadcn UI style.