Skip to content

Instantly share code, notes, and snippets.

View nimone's full-sized avatar
🚀
Pushing those rookie numbers up!

Nishant Mogha nimone

🚀
Pushing those rookie numbers up!
View GitHub Profile
@nimone
nimone / Accordion.jsx
Created January 1, 2024 08:16
An Animated Accordion Component made purely in React and Tailwind CSS .
import { createContext, useContext, useRef, useEffect, useState } from "react"
import { ChevronDown } from "react-feather"
const AccordianContext = createContext()
export default function Accordian({ children, value, onChange, ...props }) {
const [selected, setSelected] = useState(value)
useEffect(() => {
onChange?.(selected)
@nimone
nimone / App.jsx
Created November 13, 2023 09:13
A Modal Component with ReactJS and TailwindCSS
import { useState } from "react"
import Modal from "./components/Modal"
import Trash from "./icons/Trash"
export default function App() {
const [open, setOpen] = useState(false)
return (
<main className="App">
<button className="btn btn-danger" onClick={() => setOpen(true)}>
<Trash /> Delete
@nimone
nimone / App.jsx
Last active July 17, 2023 08:01
Animated icon button component in React and Tailwind CSS
import { GitHub, Twitter, Facebook, Instagram, Youtube } from "react-feather"
import IconButton from "./components/IconButton"
export default function App() {
return (
<main className="App gap-4">
<h1 className="text-gray-700 font-medium">Checkout Our Socials</h1>
<IconButton text="Github">
<GitHub size={20} />
</IconButton>
@nimone
nimone / useIntersectionObserver.ts
Created July 16, 2023 12:41
Add Infinite Scrolling to your ReactJS Projects using Intersection Observer
import { DependencyList, useCallback, useRef } from "react"
export default function useIntersectionObserver<T extends HTMLElement>(
callback: () => void,
deps: DependencyList
) {
const observer = useRef<IntersectionObserver | null>(null)
const ref = useCallback(
(node: T) => {
@nimone
nimone / App.jsx
Created July 6, 2023 07:31
Build a Plan Selection Page with Custom Radio Component using React and Tailwind CSS
import { useState } from "react"
import Radio, { RadioGroup } from "./components/Radio"
import { BadgePercent, Sparkle, Gem, Crown, ArrowRight } from "lucide-react"
export default function App() {
const [plan, setPlan] = useState("")
return (
<main className="min-h-screen flex flex-col items-center justify-center">
<h2 className="text-2xl font-bold tracking-tight">Choose Your Plan</h2>
<hr className="my-3 w-56" />
@nimone
nimone / Sidebar.jsx
Created June 29, 2023 09:33
Retractable Sidebar Component purely in ReactJS and TailwindCSS
import { MoreVertical, ChevronLast, ChevronFirst } from "lucide-react"
import { useContext, createContext, useState } from "react"
const SidebarContext = createContext()
export default function Sidebar({ children }) {
const [expanded, setExpanded] = useState(true)
return (
<aside className="h-screen">
@nimone
nimone / Carousel.jsx
Last active April 9, 2024 18:57
Build a carousel component like instagram purely in ReactJS and TailwindCSS