UIPin
ComponentsIconsIllustrationsMotionTemplatesApps
Boards
UIPin

Free, open-source UI components, icons, illustrations, motion, templates and apps, in one search. Every item links to its source and licence.

UIPin is free. If it saved you time, you can keep it running:

Buy me a coffee
ComponentsIconsIllustrationsMotionTemplatesAppsLibrariesCompareNew this weekMCP for agentsBoardsPrivacy

Components, icons and artwork belong to their authors and are shown under their open-source licences.

8bitcn/8-bit Collapsible

Data display
1 of 10
Compiling

Theme it

Every preview, live

Brand colour

Corner radius

Font

Recolours shadcn’s tokens, Tailwind’s accent colours and colours set in the code. Red, amber and green classes stay, since they usually mean error, warning or success.

10 versions·7 librariesCompare all accordions →

  • 8bitcn
  • Cult UI
  • Accordion
  • Collapsible
  • Accordion
  • Disclosure
  • React Bits
  • Accordion
  • Collapsible
  • SmoothUI

8-bit Collapsible

A simple 8-bit collapsible component

npx shadcn@latest add https://www.8bitcn.com/r/collapsible.json
Open in v0 Docs Repo
Library
8bitcn
License
MIT
Stack
React · Tailwind CSS · radix
Packages
radix-ui
Also adds
collapsible
Size
80 lines

Code

components/ui/8bit/collapsible.tsx

"use client";

import type * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
import {
  Collapsible as ShadcnCollapsible,
  CollapsibleContent as ShadcnCollapsibleContent,
  CollapsibleTrigger as ShadcnCollapsibleTrigger,
} from "@radix-ui/react-collapsible";

import { cn } from "@/lib/utils";

import "@/components/ui/8bit/styles/retro.css";

export interface BitCollapsibleProps
  extends React.ComponentProps<typeof CollapsiblePrimitive.Root> {
  asChild?: boolean;
}

function Collapsible({ children, ...props }: BitCollapsibleProps) {
  const { className } = props;

  return (
    <div className={cn("relative", className)}>
      <ShadcnCollapsible {...props} className={cn(className, "retro")}>
        {children}
      </ShadcnCollapsible>
    </div>
  );
}

function CollapsibleTrigger({
  children,
  ...props
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
  const { className } = props;
  return (
    <ShadcnCollapsibleTrigger
      data-slot="collapsible-trigger"
      className={cn(className, "retro")}
      {...props}
    >
      {children}
    </ShadcnCollapsibleTrigger>
  );
}

function CollapsibleContent({
  children,
  ...props
}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
  const { className } = props;
  return (
    <ShadcnCollapsibleContent
      data-slot="collapsible-content"
      className={cn(className, "retro")}
      {...props}
    >
      {children}
    </ShadcnCollapsibleContent>
  );
}

export { Collapsible, CollapsibleTrigger, CollapsibleContent };

More like this

8-bit Breadcrumb

8bitcn·Navigation

8-bit Label

8bitcn·Inputs & forms

8-bit Toggle

8bitcn·Buttons

8-bit Menu Bar

8bitcn·Overlays

8-bit Profile Card

8bitcn·Cards

8-bit Table

8bitcn·Navigation

8-bit Card

8bitcn·Cards

8-bit Skeleton

8bitcn·Feedback & loaders

8-bit Button

8bitcn·Buttons

Tilt

Motion Primitives·Cards

Scroll Reveal

React Bits·Cursor & effectsMIT+

Bubble

shadcn/ui·Backgrounds

Dock

Motion Primitives·Navigation

8-bit Carousel

8bitcn·Media & 3D

Carousel

Motion Primitives·Media & 3D