Skip to content

empty: Add Empty component#2314

Open
elcoosp wants to merge 1 commit intolongbridge:mainfrom
elcoosp:feat/empty
Open

empty: Add Empty component#2314
elcoosp wants to merge 1 commit intolongbridge:mainfrom
elcoosp:feat/empty

Conversation

@elcoosp
Copy link
Copy Markdown
Contributor

@elcoosp elcoosp commented Apr 28, 2026

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

  • I have read the CONTRIBUTING document and followed the guidelines.
  • Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate.
  • Passed cargo run for story tests related to the changes.
  • Tested macOS, Windows and Linux platforms performance (if the change is platform-specific)

- New `Empty` component for empty-state placeholders
- Gallery story showing minimal and full examples
- Documentation page following the Kbd structure
- Unit tests for basic creation and full configuration
- Fixes duplicate `empty_story` module and import entries
- Removes unused `h_flex` import
@huacnlee huacnlee changed the title feat: add Empty component with story, docs, and tests empty: Add Empty component May 3, 2026
@huacnlee
Copy link
Copy Markdown
Member

huacnlee commented May 3, 2026

Please follow the Shadcn UI style.

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.

2 participants