This PR implements comprehensive UI state patterns for the Credence Frontend application, including empty states, error states, and loading skeletons for all core views.
EmptyState.tsx- Configurable empty state component with 5 illustration variantsErrorState.tsx- Error state component with 4 error types (network, backend, validation, generic)LoadingSkeleton.tsx- Loading skeleton with 5 variants (text, card, form, table, dashboard)
UI_STATES_GUIDE.md- Complete guide with design principles, microcopy guidelines, and usage patternsFIGMA_DESIGN_SPECS.md- Visual specifications, color palette, layout measurements, and design tokensIMPLEMENTATION_EXAMPLES.md- Practical code examples, hooks, testing, and accessibility guidelinesREADME.md- Documentation index and quick start guide
- Added shimmer animation to
index.cssfor loading skeletons
- ✅ No bond yet
- ✅ No trust score yet
- ✅ No disputes
- ✅ No attestations
- ✅ No activity
- ✅ Network failures
- ✅ Backend errors
- ✅ Invalid addresses
- ✅ Generic errors
- ✅ Form loading
- ✅ Card/Dashboard loading
- ✅ Table loading
- ✅ Text/Content loading
- User-First: Clear language explaining why state is empty/error
- Actionable: Provide clear next steps when possible
- Consistent: Same patterns across all views
- Accessible: ARIA attributes and keyboard navigation
- Performant: Smooth animations and transitions
function MyComponent() {
const { data, isLoading, error } = useQuery()
if (isLoading) return <LoadingSkeleton variant="card" />
if (error) return <ErrorState type="network" />
if (!data) return <EmptyState title="..." description="..." />
return <Content data={data} />
}- Tone: Friendly, encouraging, never blaming
- Length: Titles 3-6 words, descriptions 1-2 sentences
- CTAs: Action-oriented verbs + outcome
src/components/states/
├── EmptyState.tsx (new)
├── ErrorState.tsx (new)
├── LoadingSkeleton.tsx (new)
└── index.ts (new)
docs/
├── UI_STATES_GUIDE.md (new)
├── FIGMA_DESIGN_SPECS.md (new)
├── IMPLEMENTATION_EXAMPLES.md (new)
└── README.md (new)
src/index.css (modified - added shimmer animation)
- Design Review: Validate with product team
- Figma: Create visual mockups and add link to FIGMA_DESIGN_SPECS.md
- Integration: Implement states in actual pages (Home, Bond, TrustScore, Activity)
- Testing: Add unit tests for state components
- Accessibility: Audit with screen readers
- All empty states render correctly
- Error states show appropriate messages
- Loading skeletons match content layout
- Responsive on mobile, tablet, desktop
- Keyboard navigation works
- Screen reader announces states correctly
- Animations are smooth
- State transitions work properly
To be added: Screenshots of each state variant
- Addresses requirement: "Design consistent empty states, error states, and loading skeletons"
- Tag:
ui-ux-design
Please review:
- Component API and prop interfaces
- Microcopy tone and messaging
- Color choices and visual hierarchy
- Documentation completeness
- Accessibility implementation
- Should we add custom illustrations instead of emojis?
- Do the error messages provide enough context?
- Are the loading skeleton variants sufficient?
- Should we add more animation options?
Branch: design/states-empty-error-loading
Commit: docs: add ui/ux specs for empty, error, and loading states
Files: 9 files changed, 1942 insertions(+)