A complete React social media application built with Material-UI to help you learn modern UI development practices.
- Modern UI Components: Built entirely with Material-UI v5
- Responsive Design: Mobile-first approach with breakpoints
- Interactive Elements: Modals, snackbars, and dynamic content
- Custom Theming: Consistent design system with custom palette
- Component Composition: Reusable and styled components
- React 18 - Latest React features
- Material-UI v5 - Modern component library
- Styled Components - Custom styling with theme integration
- Responsive Grid - Mobile-first layout system
src/
βββ components/
β βββ Add.jsx - Floating action button with modal form
β βββ Feed.jsx - Main content feed with posts
β βββ Post.jsx - Individual post component
β βββ Navbar.jsx - Responsive navigation bar
β βββ Leftbar.jsx - Side navigation menu
β βββ Rightbar.jsx - Sidebar with friends, gallery, categories
βββ App.jsx - Main app component with layout
βββ theme.js - Material-UI theme configuration
βββ index.js - App entry point
- Layout:
Grid,Container,Box - Navigation:
AppBar,Toolbar - Data Display:
Card,Avatar,ImageList,Typography - Inputs:
TextField,Button,Radio,Fab - Feedback:
Modal,Snackbar,Alert,Badge - Surfaces:
Card,CardActions,CardContent
// Custom styled components with theme
const StyledContainer = styled(Container)(({ theme }) => ({
paddingTop: theme.spacing(10),
position: "sticky",
top: 0,
}));
// Responsive breakpoints
[theme.breakpoints.down("sm")]: {
display: "none",
}export const theme = createTheme({
palette: {
primary: {
main: blue[700],
light: blue[500],
},
secondary: {
main: grey[800],
},
},
});- Mobile-first approach
- Conditional rendering with breakpoints
- Dynamic component behavior across screen sizes
- Reusable Post component
- Proper prop drilling
- Conditional content rendering
- Fixed AppBar with responsive logo
- Collapsible search bar
- Sticky sidebars
- Responsive grid layout
- Modal form with validation-ready fields
- Snackbar notifications
- Floating action button
- Dynamic avatar groups
- Image gallery with grid layout
- Categorized content
- User feed with rich posts
- Online friends display
-
Clone or create the project
-
Install dependencies:
npm install @mui/material @emotion/react @emotion/styled npm install @mui/icons-material
-
Run the development server:
npm start
- Mobile (< sm): Hidden right sidebar, collapsed menu text
- Tablet (sm-md): Full layout with adjusted spacing
- Desktop (lg+): Complete three-column layout
-
Material-UI Fundamentals
- Component usage and props
- Theming and customization
- Responsive design patterns
-
React Best Practices
- Component composition
- State management
- Event handling
-
Modern CSS-in-JS
- Styled components
- Theme integration
- Dynamic styling
-
UI/UX Principles
- Consistent spacing
- Visual hierarchy
- User interactions
- Add dark/light theme toggle
- Implement form validation
- Add real API integration
- Create user authentication flow
- Add more interactive features
- Use theme spacing for consistent margins/padding
- Leverage breakpoints for responsive behavior
- Compose components rather than creating monolithic ones
- Use the theme for colors and typography consistency
This project serves as an excellent foundation for learning Material-UI and modern React development patterns. Study the component structure, styling approaches, and responsive patterns to build your own applications!