React Basics is a personal project designed to showcase the fundamentals of React, TypeScript, and Bootstrap. This project demonstrates the creation of reusable components, state management, and event handling in a modern React application.
- 🚀 Features
- 📂 Project Structure
- 🛠️ Technologies Used
- 🌟 Key Functionalities
- ⚙️ Installation and Usage
- 🤝 Contributing
- 📜 License
- Reusable Components: Modular and reusable React components like
Button,Alert, andListGroup. - State Management: Demonstrates the use of React's
useStatehook for managing component state. - TypeScript Integration: Strongly typed components and props for better developer experience.
- Bootstrap Styling: Clean and responsive design using Bootstrap.
ReactBasics/
│── public/
│ └── vite.svg # Public assets
│── src/
│ ├── assets/
│ │ └── react.svg # React logo
│ ├── components/ # Reusable React components
│ │ ├── Alert.tsx # Alert component
│ │ ├── Button.tsx # Button component
│ │ └── ListGroup.tsx # ListGroup component
│ ├── App.tsx # Main application component
│ ├── App.css # Global styles
│ ├── Message.tsx # Message component
│ ├── main.tsx # Entry point of the application
│ └── vite-env.d.ts # Vite environment types
│── index.html # HTML entry point
├── package.json # Project dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── tsconfig.node.json # TypeScript configuration for Vite
├── vite.config.ts # Vite configuration
└── README.md # Project documentation
- React: For building user interfaces.
- TypeScript: For type safety and better code maintainability.
- Bootstrap: For responsive and modern styling.
- Vite: For fast development and build tooling.
-
Alert Component:
- Displays dismissible alerts with custom content.
- Example usage:
<Alert onClose={() => {}}>My Alert</Alert>.
-
Button Component:
- Customizable buttons with different colors and click handlers.
- Example usage:
<Button color="primary" onClick={() => {}}>Click Me</Button>.
-
ListGroup Component:
- Displays a list of items with click functionality.
- Example usage:
<ListGroup items={["Item 1", "Item 2"]} heading="My List" onSelectItem={(item) => console.log(item)} />
-
State Management:
- Demonstrates the use of
useStatefor managing visibility and selection states.
- Demonstrates the use of
- Clone the repository:
git clone https://github.com/your-username/ReactBasics.git
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Open the application in your browser at
http://localhost:5173
Contributions are welcome! If you have suggestions or improvements, feel free to fork the repository and submit a pull request.
This project is under the MIT License - see the LICENSE file for details.