Introduction
Building screens with the SampleHC UI Library - a collection of React components built on shadcn/ui
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
The useScreenFunctions
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:
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.
Configuration
The UI library is configured automatically in workflow templates through providers:
This includes React Query for data fetching, backend configuration, and screen function contexts.