Documentation Index
Fetch the complete documentation index at: https://mintlify.com/egeuysall/ryva-archive/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Ryva’s component architecture is built on shadcn/ui principles using Radix UI primitives with custom styling. Components are organized into base UI components and feature-specific compositions.Component Categories
- UI Components
- App Components
- Module Components
- Page Components
Base components in
src/components/ui/ - styled primitives ready for composition.Examples: button.tsx, input.tsx, dialog.tsx, dropdown-menu.tsxUI Component Library
Base Components
All UI components follow the shadcn/ui pattern:Button Component Example
Button Component Example
Available UI Components
Alert Dialog
Modal confirmation dialogs
Avatar
User profile images
Badge
Status and label indicators
Breadcrumb
Navigation breadcrumbs
Button
Interactive buttons
Card
Content containers
Checkbox
Boolean input controls
Dialog
Modal windows
Dropdown Menu
Contextual menus
Form
Form wrapper components
Input
Text input fields
Label
Form field labels
Select
Dropdown selectors
Separator
Visual dividers
Sidebar
Collapsible navigation
Skeleton
Loading placeholders
Switch
Toggle switches
Tooltip
Hover information
Component Patterns
1. Variant-Based Components
Use Class Variance Authority (CVA) for component variants:2. Compound Components
Related components exported together:Field Component Pattern
Field Component Pattern
3. Client Component Pattern
Next.js App Router requires explicit'use client' for interactive components:
Best Practice: Keep Server Components as the default. Only add
'use client' when you need:- React hooks (useState, useEffect, etc.)
- Browser APIs (window, localStorage)
- Event handlers
- Third-party libraries that require client context
4. Composition with Slot
Use@radix-ui/react-slot for polymorphic components:
Form Components
React Hook Form Integration
Forms use React Hook Form with Zod validation:- Form Setup
- Form Fields
- Field Component
Styling Utilities
The cn Utility
All components use the cn utility for class name merging:
cn combines clsx (conditional classes) with tailwind-merge (deduplicates Tailwind classes).Responsive Design
Tailwind breakpoints and container queries:Advanced Patterns
Memoization for Performance
Data Slots Pattern
Usedata-* attributes for styling hooks:
Loading States
Component Testing
Test components with Vitest and Testing Library:Best Practices
Keep Components Small and Focused
Keep Components Small and Focused
Each component should have a single responsibility. Extract complex logic into custom hooks.
Use TypeScript Props
Use TypeScript Props
Always define prop types for better DX and runtime safety:
Forward Refs When Needed
Forward Refs When Needed
UI components should forward refs for composition:
Avoid Prop Drilling
Avoid Prop Drilling
Use React Context or state management for deeply nested props.
Next Steps
State Management
Learn about TanStack Query and Zustand
Frontend Structure
Review the project organization