Atoms
Atoms are the foundational building blocks of the UI. These are the smallest, most reusable components that cannot be broken down further.Overview
The/components/atoms directory contains 18 primitive components organized into categories:
Form Controls
Button, Input, Label, Checkbox, Textarea, Select
Layout & Container
Card, ScrollArea, Popover
Feedback & Effects
LoadingScreen, Toast, Typewriter, TagBadge
Form Controls
Button
A versatile button component with multiple variants and sizes, built with class-variance-authority (CVA). Props Interface:components/atoms/button.tsx
Input
Standard text input component with consistent styling. Props: ExtendsReact.InputHTMLAttributes<HTMLInputElement>
Usage:
components/atoms/input.tsx
Label
Accessible label component for form fields, built with Radix UI. Props: ExtendsReact.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
Usage:
Checkbox
Checkbox component with custom styling. Props: ExtendsReact.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
Usage:
Select
Dropdown select component with trigger, content, and item subcomponents. Usage:components/atoms/select.tsx
Textarea
Multi-line text input component. Props: ExtendsReact.TextareaHTMLAttributes<HTMLTextAreaElement>
Usage:
Layout Components
Card
Container component with header, content, footer, title, and description subcomponents. Usage:components/atoms/card.tsx
ScrollArea
Custom scrollable area with styled scrollbars using Radix UI. Props: ExtendsReact.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
Usage:
Popover
Overlay component for dropdowns and tooltips. Usage:components/atoms/popover.tsx
Feedback & Effects
LoadingScreen
Full-screen loading overlay with audio consent dialog, displayed on initial page load. Features:- Animated entrance/exit with Framer Motion
- Shader background effect
- Bilingual text (English & Gujarati)
- Audio consent buttons
- Loading progress indicator
components/atoms/loading-screen.tsx
components/atoms/loading-screen.tsx
Typewriter
Animated text effect that types characters one by one. Props Interface:components/atoms/typewriter.tsx
ScrollToTop
Floating button that appears after scrolling, with adaptive styling based on background color. Features:- Appears after 300px scroll
- Detects background brightness
- Smooth scroll animation
- Optimized with RAF (requestAnimationFrame)
components/atoms/scroll-to-top.tsx
FloatingButton
Reusable floating button with adaptive styling. Props Interface:components/atoms/floating-button.tsx
AudioChoiceButton
Specialized button for audio consent on loading screen. Props Interface:components/atoms/audio-choice-button.tsx
TagBadge
Colored badge for event tags and categories. Props Interface:components/atoms/tag-badge.tsx
Toast
Notification component for user feedback. Usage:Utility Components
ThemeProvider
Context provider for theme management (forced to light mode in this project). Usage:components/atoms/theme-provider.tsx
RegularLogo
Static logo component. Usage:Styling Patterns
All atoms use consistent Tailwind patterns:Custom CSS Classes
Color Palette
Best Practices
Component Composition
Component Composition
Prefer composition over configuration:
Type Safety
Type Safety
Always use TypeScript interfaces:
Accessibility
Accessibility
- Use semantic HTML elements
- Include aria-labels for icon buttons
- Leverage Radix UI for accessible primitives
- Support keyboard navigation
Next Steps
Molecules
Learn about composite components that combine atoms
Organisms
Explore complex sections built from molecules and atoms
