Overview
The Sample UI Library is a comprehensive collection of React components and hooks designed specifically for building workflow screens in the SampleHC platform. Built on top of shadcn/ui, it provides both low-level UI primitives and high-level, domain-specific components for healthcare workflows.Getting Started
All workflow templates come with the Sample UI library pre-configured. To use any component in your screen:Pre-installed Components
The following shadcn/ui components are pre-installed and available in every workflow template:Older workflows built from the previous templates may not have all components available - please use the
shadcn
CLI to install any packages you need.Workflow Integration
Screen Functions
TheuseScreenFunctions
hook provides essential workflow operations:
Task State Management
As React components are stateless by default, the SampleHC UI library provides a hook to persist data across workflow steps.Data Fetching Hooks
Hooks for API integration and data management:Document Management Hooks
Document Management Hooks
useDocumentUpload()
- Upload documents to the platformuseDocumentMetadata(documentId)
- Fetch document metadatauseDocuments(documentIds)
- Fetch multiple documentsuseDocumentExtractionResult(resultId)
- Monitor extraction results
Task & Workflow Hooks
Task & Workflow Hooks
useTaskState(key, initialValue)
- Persistent task stateuseFullTaskState(taskId)
- Complete task state objectuseTaskSuspendedPayload(taskId)
- Suspended task detailsuseCompleteMutation()
- Complete workflow tasksuseCancelMutation()
- Cancel workflow tasks
Search & Classification
Search & Classification
useDocumentSearch()
- Search across documentsusePayerSearch(query)
- Search healthcare payersuseDocumentClassificationResult()
- Document classification results
Utility Hooks
Additional hooks for common patterns:useDebounce(value, delay)
- Debounce rapidly changing valuesuseLocalStorage(key, initialValue)
- Persist data in browser storage
Sample Components
Specialized components built for healthcare workflows:Form Component
Advanced form builder with document upload, CSV processing, and validation.
Rich Text Editor
Tiptap-based editor with healthcare-specific extensions and citation support.
Payer Search
Searchable combobox for finding healthcare payers with autocomplete.
PDF Viewer
Interactive PDF viewer with annotation and highlighting capabilities.
Document Viewer
Unified viewer for various document types including PDFs and FHIR data.