uiComponents
v0.1.0

CodeSweeper

Removes redundant code from your components with a single click.

tokens: 0reduced: 0%
activitycombo x00/sbest x0
accordion.tsx
"use client"

import * as React from "react"
import { ChevronDown } from "lucide-react"
import { cn } from "@/lib/utils"

interface AccordionContextValue {
  openValue: string
  setOpenValue: (value: string) => void
}

const AccordionContext = React.createContext<AccordionContextValue | null>(null)

export function Accordion({
  children,
  defaultValue,
  className,
}: {
  children: React.ReactNode
  defaultValue?: string
  className?: string
}) {
  const [openValue, setOpenValue] = React.useState(defaultValue ?? "")
  return (
    <AccordionContext.Provider value={{ openValue, setOpenValue }}>
      <div className={cn("divide-y rounded-lg border", className)}>{children}</div>
    </AccordionContext.Provider>
  )
}

Click any token to remove it from the bundle.