tsimport {XDSEmptyState} from '@xds/core/EmptyState'
| Guidance | Practices |
|---|---|
| Do | Include a clear title and a call-to-action button so users know how to proceed. |
| Do | Use an illustration or icon that reinforces the context of the empty state. |
| Do | Use the compact variant inside cards or sidebars where space is limited. |
| Don't | Leave an empty state without guidance — always explain what happened and what the user can do next. |
| Don't | Use a generic message like "No data" — be specific about what is empty and why. |
| Don't | Use an EmptyState for error messages that require immediate action — use a Banner instead. |
tsx'use client';import {XDSEmptyState} from '@xds/core/EmptyState';import {XDSButton} from '@xds/core/Button';import {XDSIcon} from '@xds/core/Icon';import {MagnifyingGlassIcon} from '@heroicons/react/24/outline';export default function EmptyStateActions() {return (<XDSEmptyStateicon={<XDSIcon icon={MagnifyingGlassIcon} size="lg" />}title="No results found"description="Try adjusting your search terms or clearing filters to see more results."actions={<><XDSButton label="Go back" variant="secondary" /><XDSButton label="Clear filters" variant="primary" /></>}/>);}
tsx'use client';import {XDSEmptyState} from '@xds/core/EmptyState';import {XDSButton} from '@xds/core/Button';import {XDSHStack} from '@xds/core/Layout';import {XDSIcon} from '@xds/core/Icon';import {InboxIcon} from '@heroicons/react/24/outline';export default function EmptyStateCompact() {return (<XDSEmptyStateicon={<XDSIcon icon={InboxIcon} size="lg" />}title="No notifications"description="You're all caught up. New notifications will appear here."actions={<XDSHStack gap={2}><XDSButton label="Settings" variant="secondary" size="sm" /><XDSButton label="Refresh" variant="primary" size="sm" /></XDSHStack>}isCompact/>);}
tsx'use client';import {XDSEmptyState} from '@xds/core/EmptyState';import {XDSButton} from '@xds/core/Button';import {XDSCard} from '@xds/core/Card';import {XDSIcon} from '@xds/core/Icon';import {FolderPlusIcon} from '@heroicons/react/24/outline';export default function EmptyStateContainer() {return (<XDSCard><XDSEmptyStateicon={<XDSIcon icon={FolderPlusIcon} size="lg" />}title="No projects yet"description="Create your first project to start organizing your work. You can invite team members after."actions={<><XDSButton label="Import" variant="secondary" /><XDSButton label="Create project" variant="primary" /></>}/></XDSCard>);}
tsx'use client';import {XDSEmptyState} from '@xds/core/EmptyState';import {XDSButton} from '@xds/core/Button';import {XDSIcon} from '@xds/core/Icon';import {MagnifyingGlassIcon} from '@heroicons/react/24/outline';export default function EmptyStateShowcase() {return (<XDSEmptyStateicon={<XDSIcon icon={MagnifyingGlassIcon} size="lg" />}title="No results found"description="Try adjusting your search or filters to find what you need."actions={<XDSButton label="Clear filters" variant="secondary" />}/>);}