gpui-component icon indicating copy to clipboard operation
gpui-component copied to clipboard

empty: Add Empty component

Open elcoosp opened this issue 7 months ago • 1 comments

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_flex import to keep the codebase clean.

All changes are additive and non‑breaking.

Screenshot

Before After
[Put Before Screenshot here] empty

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 run for story tests related to the changes.
  • [ ] Tested macOS, Windows and Linux platforms performance (if the change is platform-specific)

elcoosp avatar Apr 28 '26 17:04 elcoosp

Please follow the Shadcn UI style.

huacnlee avatar May 03 '26 14:05 huacnlee