Skip to content

Conversation

@ehmasuk
Copy link
Contributor

@ehmasuk ehmasuk commented Jan 14, 2026

This Pull Request introduces the Empty component, a modular and styled element used to display states when no data is available. It follows the library's retro aesthetic.

What's included:

  • Modular Component: A flexible Empty component with sub-components (Empty.Icon, Empty.Title, Empty.Description, etc.) for high customization.
  • Comprehensive Documentation: Added a new docs page (empty.mdx) with installation steps and API details.
  • Live Previews: Included 4 different preview styles (Default, Custom Icon, Fully Customized, and Table Integration).
  • Project Integration: Registered the component in the registry and added it to the sidebar navigation with a "New" tag.

Example component structure :

<Empty.Content>
<Empty.Icon />
<Empty.Title>No Data Found</Empty.Title>
<Empty.Separator />
<Empty.Description>Try adjusting your search filters.</Empty.Description>
</Empty.Content>

Examples:
image
image
image
image

Summary by CodeRabbit

  • New Features
    • Added a new Empty State component with configurable subcomponents (icon, title, separator, description).
    • Four example variants demonstrating default, custom icon, fully customized, and table use cases.
  • Documentation
    • Added a documentation page and a new navigation entry for the Empty component.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Jan 14, 2026

@ehmasuk is attempting to deploy a commit to the Retro UI Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 14, 2026

📝 Walkthrough

Walkthrough

A new composite React Empty component (with nested Content, Icon, Title, Separator, Description) was added, plus docs, navigation entry, config registration, and four preview/example components demonstrating usage.

Changes

Cohort / File(s) Summary
Component Implementation
components/retroui/Empty.tsx
New composite React Empty component with nested subcomponents: Empty.Content, Empty.Icon, Empty.Title, Empty.Separator, Empty.Description. Uses forwarded props, displayName on parts, and a default Ghost icon.
Module Exports
components/retroui/index.ts
Updated exports: removed Input export and added Empty export to the retroui index (public API changed).
Configuration
config/components.ts, config/navigation.ts
Registered empty in core component map and added four example entries (preview/components/empty-style-*.tsx); added navigation item for "Empty" under Components with tag "New".
Documentation
content/docs/components/empty.mdx
New documentation page with frontmatter, live showcase, install/copy instructions, four usage examples, and API reference for Empty and its subcomponents.
Examples / Previews
preview/components/empty-style-default.tsx, preview/components/empty-style-custom-icon.tsx, preview/components/empty-style-custom-everything.tsx, preview/components/empty-style-table.tsx
Added four preview/example components showing default, custom icon, fully customized (with Button and InboxIcon), and table-integrated usages.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I stitched an Empty with whiskers bright,

Icons and titles in gentle light,
When lists go quiet and tables sleep,
I hop in softly where emptiness keeps,
A tiny cheer for UIs neat.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'feat: add Empty component with documentation and previews' directly and comprehensively summarizes the main changes: a new Empty component is introduced with full documentation and preview examples.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

🧹 Recent nitpick comments
config/components.ts (1)

722-741: Consider alphabetical placement for consistency.

The new entries are correctly structured but appended at the end. Other component examples in this file are roughly grouped alphabetically (e.g., accordion-*, alert-*, avatar-*...). Moving these entries after drawer-* and before input-* would maintain consistency.

This is a minor readability nit and doesn't affect functionality.


📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between caf1241 and 2829c75.

📒 Files selected for processing (6)
  • components/retroui/Empty.tsx
  • components/retroui/index.ts
  • config/components.ts
  • preview/components/empty-style-custom-everything.tsx
  • preview/components/empty-style-default.tsx
  • preview/components/empty-style-table.tsx
🚧 Files skipped from review as they are similar to previous changes (3)
  • preview/components/empty-style-custom-everything.tsx
  • preview/components/empty-style-table.tsx
  • components/retroui/Empty.tsx
🔇 Additional comments (3)
components/retroui/index.ts (1)

28-29: LGTM! New exports correctly added to the barrel file.

The exports for ContextMenu and Empty follow the existing pattern.

Note: The AI summary incorrectly states that export * from "./Input" was removed, but line 2 shows Input is still exported. The summary is inconsistent with the actual code.

preview/components/empty-style-default.tsx (1)

1-16: LGTM!

Clean preview component that demonstrates the Empty component's composition pattern with appropriate responsive styling.

config/components.ts (1)

86-89: LGTM!

The core component registration follows the established pattern.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@preview/components/empty-style-table.tsx`:
- Line 27: The Tailwind class on Empty.Title is invalid: replace the
non-existent "md:text-md" with a valid utility such as "text-base" (or if you
meant a responsive style, use "md:text-base" or "md:text-sm"); update the
className on Empty.Title to use one of these valid Tailwind text-size utilities.
🧹 Nitpick comments (8)
components/retroui/Empty.tsx (2)

6-8: Redundant className property in interface.

HTMLAttributes<HTMLDivElement> already includes className, so explicitly declaring it here is unnecessary.

Suggested fix
-interface IEmptyProps extends HTMLAttributes<HTMLDivElement> {
-  className?: string;
-}
+interface IEmptyProps extends HTMLAttributes<HTMLDivElement> {}

53-55: Consider adding accessibility attributes to the separator.

For better accessibility, consider adding role="separator" to make the semantic purpose explicit to assistive technologies.

Suggested fix
 const EmptySeparator = ({ className, ...props }: IEmptyProps) => {
-  return <div className={cn("w-full h-1 bg-primary", className)} {...props} />;
+  return <div role="separator" className={cn("w-full h-1 bg-primary", className)} {...props} />;
 };
components/retroui/index.ts (1)

2-9: Pre-existing duplicate export detected.

Note: "./Input" is exported twice (lines 2 and 9). While not introduced in this PR, consider removing the duplicate in a follow-up.

preview/components/empty-style-custom-everything.tsx (1)

1-2: Inconsistent import pattern.

Button is imported from the barrel file while Empty is imported directly. For consistency, consider importing both from the same source.

Option 1: Both from barrel
-import { Button } from "@/components/retroui";
-import { Empty } from "@/components/retroui/Empty";
+import { Button, Empty } from "@/components/retroui";
preview/components/empty-style-default.tsx (1)

1-1: Consider importing from the barrel file for consistency.

Similar to the other preview file, consider importing from @/components/retroui for consistency across the codebase.

Suggested change
-import { Empty } from "@/components/retroui/Empty";
+import { Empty } from "@/components/retroui";
preview/components/empty-style-table.tsx (2)

21-21: Prefer strict equality operator.

Use === instead of == for comparing invoices.length to 0 to avoid type coercion surprises.

Suggested fix
-        {invoices?.length == 0 && (
+        {invoices?.length === 0 && (

23-23: Remove empty className attribute.

The empty className="" serves no purpose.

Suggested fix
-            <Table.Cell colSpan={5} className="">
+            <Table.Cell colSpan={5}>
config/components.ts (1)

164-167: Consider alphabetical ordering for core components.

The empty entry is placed at the end of the core object, but other entries appear to follow alphabetical order. For consistency and easier navigation, consider moving it between drawer and input.

Suggested placement
     drawer: {
       name: "drawer",
       filePath: "components/retroui/Drawer.tsx",
     },
+    empty: {
+      name: "empty",
+      filePath: "components/retroui/Empty.tsx",
+    },
     input: {
       name: "input",
       filePath: "components/retroui/Input.tsx",
     },

And remove from lines 164-167.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f21985c and e17c9ed.

📒 Files selected for processing (9)
  • components/retroui/Empty.tsx
  • components/retroui/index.ts
  • config/components.ts
  • config/navigation.ts
  • content/docs/components/empty.mdx
  • preview/components/empty-style-custom-everything.tsx
  • preview/components/empty-style-custom-icon.tsx
  • preview/components/empty-style-default.tsx
  • preview/components/empty-style-table.tsx
🧰 Additional context used
🧬 Code graph analysis (2)
preview/components/empty-style-custom-everything.tsx (1)
components/retroui/Button.tsx (1)
  • Button (40-63)
components/retroui/Empty.tsx (2)
lib/utils.ts (1)
  • cn (4-6)
components/retroui/Text.tsx (1)
  • Text (30-37)
🔇 Additional comments (10)
components/retroui/Empty.tsx (1)

69-77: LGTM! Well-structured compound component pattern.

The Object.assign approach is idiomatic for React compound components, providing a clean API (Empty.Content, Empty.Icon, etc.) while maintaining proper display names for debugging.

components/retroui/index.ts (1)

29-30: LGTM! New exports correctly added.

The Empty component is properly exported as part of the public API.

config/navigation.ts (1)

61-61: LGTM! Navigation entry correctly added.

The entry maintains alphabetical ordering and follows the existing pattern for new components with the "New" tag.

preview/components/empty-style-custom-everything.tsx (1)

5-19: LGTM! Good example of a fully customized empty state.

This preview effectively demonstrates the flexibility of the Empty component with a custom icon, content, and an action button.

preview/components/empty-style-default.tsx (1)

3-15: LGTM! Clean default example.

This provides a clear and straightforward demonstration of the Empty component's default usage pattern with all sub-components.

preview/components/empty-style-table.tsx (1)

1-5: LGTM!

Imports and demo data setup look correct for a preview component.

content/docs/components/empty.mdx (2)

5-6: Verify the source URL organization name.

The source link points to Logging-Stuff but the PR is from Logging-Studio. Please confirm the correct GitHub organization name.


9-70: LGTM!

Documentation structure is well-organized with clear examples covering default usage, custom icons, full customization, and table integration. The API reference succinctly describes all sub-components.

preview/components/empty-style-custom-icon.tsx (1)

1-19: LGTM!

Clean demonstration of the custom icon capability using the Empty component's compositional API.

config/components.ts (1)

723-742: LGTM!

The four example entries follow the established pattern and correctly reference the new preview components with lazy loading.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

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