A modern React application featuring dynamic form management with a responsive navigation system, powered by React Router and Context API.
- Responsive navigation with active state indicators
- Form submission and management
- Favorites system
- Global state management using Context API
- Dynamic routing with React Router
- Mobile-responsive design with Tailwind CSS
- CRUD operations for forms
- React.js
- React Router DOM
- Context API
- Tailwind CSS
- Modern JavaScript (ES6+)
/src
|-- components/
| |-- Header.jsx
| |-- FormNav.jsx
| |-- Form.jsx
| |-- RegisterForm.jsx
| |-- SubmittedForms.jsx
| |-- FavoriteForms.jsx
|-- context/
| |-- FormContext.jsx
|-- App.jsx
|-- main.jsx
The navigation component (FormNav.jsx
) implements a responsive design with active state indicators:
const FormNav = () => {
return (
<nav className="flex gap-10 justify-center p-4 border-b border-gray-700
font-raleway font-medium text-xl max-sm:text-sm max-sm:w-full max-sm:gap-5">
<NavLink
to="/"
className={({ isActive }) =>
isActive
? "border-b-4 text-white border-orange-400 rounded-md
ease-in-out duration-100 py-1"
: "text-white py-1"
}
>
Register
</NavLink>
// Similar NavLink components for Submitted and Favorite Forms
</nav>
);
};
- Active state indication with orange border
- Smooth transitions with ease-in-out
- Mobile-responsive text sizing
- Consistent spacing and padding
- Clean, modern design aesthetic
const FormContext = createContext();
const FormProvider = ({ children }) => {
const [submittedData, setSubmittedData] = useState([]);
const [favoriteData, setFavoriteData] = useState([]);
// Form management functions
const submitForm = (formData) => {
setSubmittedData((prev) => [...prev, formData]);
if (formData.isfavorite) {
setFavoriteData((prev) => [...prev, formData]);
}
};
// Delete operations included
// ... delete functions
};
<Routes>
<Route path="/" element={<Form />} >
<Route path="/" element={<RegisterForm/>} />
<Route path="/submitted" element={<SubmittedForm />} />
<Route path="/favorites" element={<FavoriteForm />} />
</Route>
</Routes>
/* Tailwind CSS Classes Used */
.flex /* Flexbox layout */
.gap-10 /* Gap between items */
.justify-center /* Center alignment */
.border-b /* Bottom border */
.border-gray-700 /* Border color */
.text-white /* Text color */
.font-raleway /* Font family */
.text-xl /* Text size */
.max-sm:text-sm /* Mobile responsive */
- Desktop-first approach
- Mobile breakpoints for smaller screens
- Flexible gap spacing
- Responsive text sizing
- Clone the repository
git clone https://github.com/Bloivating-Major/KODR.git
- Install dependencies
npm install
- Start the development server
npm run dev
- Mobile-friendly navigation
- Adaptive text sizes
- Flexible spacing
- Preserved functionality across devices
- Active route indication
- Smooth transitions
- Mobile responsiveness
- Intuitive user interface
- Submit new forms
- View submitted forms
- Manage favorite forms
- Delete forms from both lists
- Centralized state using Context API
- Separate states for submitted and favorite forms
- CRUD operations managed through context
- User navigates through tabs
- Submits form →
submitForm()
- Data stored in context →
submittedData
- If marked as favorite → Added to
favoriteData
- Delete operations → Remove from respective states
- Enhanced navigation animations
- Form validation
- Data persistence
- User authentication
- Search functionality
- Form categories
- Export/Import functionality
- Fork the repository
- Create your feature branch (
git checkout -b feature/YourFeature
) - Commit your changes (
git commit -m 'Add YourFeature'
) - Push to the branch (
git push origin feature/YourFeature
) - Open a Pull Request
- Use consistent styling patterns
- Follow the established routing structure
- Maintain mobile responsiveness
- Test across different devices
- Keep state management centralized
This project is licensed under the MIT License - see the LICENSE file for details.
Happy Coding! 🚀✨