Documentation Index
Fetch the complete documentation index at: https://grantmaster.dev/llms.txt
Use this file to discover all available pages before exploring further.
Components & Styling
GrantMaster uses a modern, utility-first styling approach combined with a robust component library.1. The Design System (Tailwind CSS 4)
We use Tailwind CSS 4 for all styling. Design tokens are defined via the@theme block in src/index.css (not a tailwind.config.js file):
- Primary (
primary-*): Brand blue for main actions. Never hardcodeblue-*. - Neutrals (
slate-*): All neutral/gray tones. Never usegray-*. - Success (
emerald-*): Approval/confirm actions. Never usegreen-*. - Error (
rose-*): Delete/reject/destructive actions. Never usered-*. - Warning (
amber-*): Cautionary states. - Muted: Background containers and subtle text.
Utility Usage Policy
- Prefer Composition: Avoid creating large CSS files. Use Tailwind classes directly in TSX.
- Responsive Design: Always use
sm:,md:,lg:prefixes. GrantMaster is “Mobile First”. - Dark Mode: All components must support
dark:variants. Usedark:bg-{color}-500/10for subtle tints.
2. Component Library (shadcn/ui)
We don’t build basic inputs or buttons from scratch. We use shadcn/ui, which is a collection of re-usable components built on Radix UI.shadcn/ui Primitives (src/components/ui/)
| Component | File | Notes |
|---|---|---|
| AlertDialog | alert-dialog.tsx | Confirmation dialogs |
| Alert | alert.tsx | Inline alert banners |
| Badge | badge.tsx | Non-status labels |
| Button | button.tsx | default, outline, ghost, destructive, success, warning, secondary, link variants. Use isLoading/loadingText props |
| Card | card.tsx | Composable Card/CardHeader/CardContent/CardFooter |
| Checkbox | checkbox.tsx | |
| Command | command.tsx | Command palette (cmdk) |
| Dialog | dialog.tsx | Accessible modals |
| DropdownMenu | dropdown-menu.tsx | Context menus |
| Input | input.tsx | Text inputs |
| Label | label.tsx | |
| Popover | popover.tsx | |
| Progress | progress.tsx | Progress bars |
| ScrollArea | scroll-area.tsx | Custom scrollable containers |
| Select | select.tsx | Dropdown selects |
| Separator | separator.tsx | Dividers |
| Sheet | sheet.tsx | Side-over panels |
| Skeleton | skeleton.tsx | Loading placeholders |
| Switch | switch.tsx | Toggle switches |
| Table | table.tsx | Base table elements |
| Tabs | tabs.tsx | Tab containers |
| Textarea | textarea.tsx | Multi-line inputs |
Custom Components (src/components/ui/)
| Component | File | Notes |
|---|---|---|
| AnimatedIcon | AnimatedIcon.tsx | Icon with motion effects |
| BottomSheet | BottomSheet.tsx | Mobile bottom drawer |
| Breadcrumbs | Breadcrumbs.tsx | Navigation breadcrumbs |
| CardVariants | CardVariants.tsx | Preset card styles + StatCard for metrics |
| CitationList | CitationList.tsx | AI citation display |
| ConfidenceBadge | ConfidenceBadge.tsx | AI confidence indicator |
| DataStateWrapper | DataStateWrapper.tsx | Loading/empty/error state handler |
| EmptyState | EmptyState.tsx | Zero-data illustrations |
| ErrorBoundary | ErrorBoundary.tsx | React error boundary |
| FloatingActionButton | FloatingActionButton.tsx | FAB for mobile |
| FormComponents | FormComponents.tsx | FormField, FormSection, FormActions, FormGrid |
| KeyboardShortcutsModal | KeyboardShortcutsModal.tsx | Shortcuts reference |
| LoadingScreen | LoadingScreen.tsx | Full-page loading |
| Modal | Modal.tsx | Standard modal wrapper |
| PageHeader | PageHeader.tsx | Standardized page titles (replaces manual <h1>) |
| PageLayout | PageLayout.tsx | Page content wrapper (mandatory) |
| PageTabs | PageTabs.tsx | Page-level tab navigation |
| PremiumTabs | PremiumTabs.tsx | Standard section-level tabs (default and card variants) |
| RouteErrorBoundary | RouteErrorBoundary.tsx | Route-level error handling |
| ScrollToTop | ScrollToTop.tsx | Auto-scroll on navigation |
| SearchFilterBar | SearchFilterBar.tsx | Debounced search + filters |
| SecondarySidebar | SecondarySidebar.tsx | Left-side sub-navigation |
| SkeletonLoader | SkeletonLoader.tsx | Skeleton loading patterns |
| StaggeredList | StaggeredList.tsx | Animated list rendering |
| StatusBadge | StatusBadge.tsx | Status indicators with mapDomainStatus() |
| Tooltip | Tooltip.tsx | Custom tooltip (use content + side props) |
| VirtualList | VirtualList.tsx | Virtualized scrolling (react-window) |
| WarningBanner | WarningBanner.tsx | Warning alert banners |
Data Table (src/components/ui/data-table/)
Standardized table components with sorting, filtering, pagination, and bulk action toolbar. Built on @tanstack/react-table.
3. Creating a New Component
Follow this folder structure:Reference Example
Seesrc/components/ui/button.tsx for how we use cva (Class Variance Authority) to manage component states.
4. Visual Excellence (Wow Factor)
To maintain a “Premium” feel:- Animations: Use
motion(npm packagemotion@^12) for page transitions and modal entries. Note: decorative CSS animations are globally disabled; only functional animations (spinners, shimmer) are preserved. - Gradients: Use subtle gradients on dashboard cards (
.bg-gradient-card,.bg-gradient-surface). - Glassmorphism: Use
.glass-surface,.glass-card,.glass-panel,.glass-frostedutility classes for backdrop-blur effects.
Maintenance
Update this document when:- Adding a new external UI library (e.g., Radix).
- Changing the primary brand colors.
- Introducing a new global animation standard.