A pixel-accurate, responsive settings page implemented in React based on provided mockups. It demonstrates modern React patterns, accessible UI primitives, themeing with CSS variables and Tailwind CSS, and a clean component architecture.
View Demo: https://my-settings-page.netlify.app/
- Pixel-accurate UI: Layout, spacing, and typography closely match the mock design.
- Responsive design: Scales cleanly from mobile to desktop.
- Light/Dark theme toggle: Uses a header switch to toggle between
lightanddarkmodes. - Email list: Displays primary/verified states with badges and dropdown menu to manage/delete emails.
- Email settings: Configurable default and backup email selects, and privacy switch.
- React 19: Modern, declarative UI library for building interactive and composable components.
- TypeScript: Ensures strong typing for props, state, and domain models, reducing runtime errors.
- Vite: Lightning-fast development builds with optimized bundling (simplifies setup for unit tests via
Vitestin future). - Tailwind CSS v4: Utility-first styling framework leveraging design tokens via CSS custom properties, enabling rapid, consistent UI development.
- Radix UI primitives (
@radix-ui/react-*): Accessible, unstyled building blocks for complex UI elements (buttons, menus, selects, switches, etc.), giving full design flexibility. - Class Variance Authority (CVA): Manage component variants and styling combinations in a type-safe and reusable way.
- Lucide React: Lightweight, modern SVG icon library for clean, scalable icons.
This combination prioritizes developer productivity, accessibility, performance, and maintainable styling.
react-settings-page/
├─ index.html
├─ src/
│ ├─ main.tsx # App bootstrap
│ ├─ App.tsx # Page layout, theme toggle, composition
│ ├─ index.css # Tailwind setup + CSS variables (themes)
│ ├─ lib/
│ │ └─ utils.ts # Utilities (e.g., className helper)
│ ├─ types/
│ │ └─ email.ts # Email domain model
│ ├─ components/
│ │ ├─ email-list.tsx # Email list with badges + actions
│ │ ├─ email-settings.tsx # Settings cards (selects, switches)
│ │ └─ ui/ # Primitive UI components (Button, Card, etc.)
│ │ ├─ badge.tsx
│ │ ├─ button.tsx
│ │ ├─ card.tsx
│ │ ├─ dropdown-menu.tsx
│ │ ├─ label.tsx
│ │ ├─ select.tsx
│ │ ├─ separator.tsx
│ │ └─ switch.tsx
-
Prerequisites
- Node.js 18+ (recommended 20+)
- npm 9+
-
Install dependencies
npm install
-
Start the dev server
npm run dev
Open the URL printed in the terminal (typically http://localhost:5173).
-
Build for production and preview (Optional)
npm run build && npm run preview -
Linting codebase (Optional)
npm run lint
- Real data & actions: Integrate API calls via
RESTorGraphQLfrom a backend service, or mock withMSWduring development. - Persisted preferences: Save
themeand other user preferences tolocalStoragefor a consistent experience across sessions. - Form validation: Add client-side validation using
zodorreact-hook-formfor robust and type-safe forms. - Testing: Implement unit tests with
Vitest + React TestingLibrary and end-to-end/integration tests withPlaywright. - State management: Introduce
Zustandfor state management andReact Queryfor data fetching and catching, as the project scales.





