code-collapsible-wrapper.tsx — ui Source File
Architecture documentation for code-collapsible-wrapper.tsx, a tsx file in the ui codebase. 5 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR d929be93_f872_15d9_36e9_434226df2277["code-collapsible-wrapper.tsx"] 1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"] d929be93_f872_15d9_36e9_434226df2277 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2 79081a1f_55a3_945a_fb8c_d53d6d3eab81["utils"] d929be93_f872_15d9_36e9_434226df2277 --> 79081a1f_55a3_945a_fb8c_d53d6d3eab81 57e86e45_ac6e_7278_be08_9092724e8401["button"] d929be93_f872_15d9_36e9_434226df2277 --> 57e86e45_ac6e_7278_be08_9092724e8401 72adfc27_1b6f_cf8f_62c6_bf495c5c0910["collapsible"] d929be93_f872_15d9_36e9_434226df2277 --> 72adfc27_1b6f_cf8f_62c6_bf495c5c0910 b2c60dee_4ede_8485_a6b4_91c999cdc69f["separator"] d929be93_f872_15d9_36e9_434226df2277 --> b2c60dee_4ede_8485_a6b4_91c999cdc69f style d929be93_f872_15d9_36e9_434226df2277 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"use client"
import * as React from "react"
import { cn } from "@/lib/utils"
import { Button } from "@/registry/new-york-v4/ui/button"
import {
Collapsible,
CollapsibleContent,
CollapsibleTrigger,
} from "@/registry/new-york-v4/ui/collapsible"
import { Separator } from "@/registry/new-york-v4/ui/separator"
export function CodeCollapsibleWrapper({
className,
children,
...props
}: React.ComponentProps<typeof Collapsible>) {
const [isOpened, setIsOpened] = React.useState(false)
return (
<Collapsible
open={isOpened}
onOpenChange={setIsOpened}
className={cn("group/collapsible relative md:-mx-1", className)}
{...props}
>
<CollapsibleTrigger asChild>
<div className="absolute top-1.5 right-9 z-10 flex items-center">
<Button
variant="ghost"
size="sm"
className="text-muted-foreground h-7 rounded-md px-2"
>
{isOpened ? "Collapse" : "Expand"}
</Button>
<Separator orientation="vertical" className="mx-1.5 !h-4" />
</div>
</CollapsibleTrigger>
<CollapsibleContent
forceMount
className="relative mt-6 overflow-hidden data-[state=closed]:max-h-64 data-[state=closed]:[content-visibility:auto] [&>figure]:mt-0 [&>figure]:md:!mx-0"
>
{children}
</CollapsibleContent>
<CollapsibleTrigger className="from-code/70 to-code text-muted-foreground absolute inset-x-0 -bottom-2 flex h-20 items-center justify-center rounded-b-lg bg-gradient-to-b text-sm group-data-[state=open]/collapsible:hidden">
{isOpened ? "Collapse" : "Expand"}
</CollapsibleTrigger>
</Collapsible>
)
}
Domain
Subdomains
Functions
Dependencies
- button
- collapsible
- react
- separator
- utils
Source
Frequently Asked Questions
What does code-collapsible-wrapper.tsx do?
code-collapsible-wrapper.tsx is a source file in the ui codebase, written in tsx. It belongs to the Internationalization domain, RTLLayout subdomain.
What functions are defined in code-collapsible-wrapper.tsx?
code-collapsible-wrapper.tsx defines 1 function(s): CodeCollapsibleWrapper.
What does code-collapsible-wrapper.tsx depend on?
code-collapsible-wrapper.tsx imports 5 module(s): button, collapsible, react, separator, utils.
Where is code-collapsible-wrapper.tsx in the architecture?
code-collapsible-wrapper.tsx is located at apps/v4/components/code-collapsible-wrapper.tsx (domain: Internationalization, subdomain: RTLLayout, directory: apps/v4/components).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free