@payfit/unity-components
Version:
49 lines (48 loc) • 2.51 kB
TypeScript
import { PropsWithChildren } from 'react';
export interface EmptyStateProps extends PropsWithChildren {
/**
* The ARIA role for the empty state container.
* @default 'status'
*/
role?: string;
/**
* Additional CSS class names.
*/
className?: string;
}
/**
* EmptyState communicates the absence of data or content to users while providing clear guidance on next steps.
* Use this component when there's no data to display, when filters return no results, when a feature requires prerequisites, or when celebrating task completion.
* The component provides a flexible composition system through its parts (`EmptyStateIcon`, `EmptyStateContent`, `EmptyStateActions`) for creating custom empty states, as well as preset components for common scenarios.
* @param {EmptyStateProps} props - The component props including optional `role` and `className`.
* @example
* ```tsx
* import { EmptyState, EmptyStateIcon, EmptyStateContent, EmptyStateActions, Button } from '@payfit/unity-components'
*
* function DocumentList() {
* return (
* <EmptyState>
* <EmptyStateIcon icon="DocumentOutlined" variant="neutral" />
* <EmptyStateContent
* title="No documents yet"
* description="Create your first document to get started."
* />
* <EmptyStateActions>
* <Button variant="ghost">Create document</Button>
* </EmptyStateActions>
* </EmptyState>
* )
* }
* ```
* @remarks
* - The component is composable through its part components for maximum flexibility
* - For common use cases, use preset components like `EmptyStateGetStarted`, `EmptyStateNoSearchResults`, etc.
* - The component uses `role="status"` by default for accessibility, announcing changes to screen readers
* - All empty state presets include built-in internationalization support
* @see {@link EmptyStateProps} for all available props
* @see Source code in {@link https://github.com/PayFit/hr-apps/tree/master/libs/shared/unity/components/src/components/empty-state GitHub}
* @see Design specs in {@link https://www.figma.com/design/poaMyU7abAgL9VRhx4ygyy/Unity-DS-%3E-Components-Library?node-id=16600-5334 Figma}
* @see Developer docs in {@link https://unity-components.payfit.io/?path=/docs/component-reference-emptystate--docs unity-components.payfit.io}
*/
declare const EmptyState: import('react').ForwardRefExoticComponent<EmptyStateProps & import('react').RefAttributes<HTMLDivElement>>;
export { EmptyState };