Find files related to a demo/preview component with tabs "Demo" and "Code". Look for components that might contain a demo box and text/content area. Search for files containing "Demo", "Code" tabs, or component preview/display functionality. Check src/ directory and any component directories. Return the file paths and relevant code sections.
Assistant
Here are the results of my search. The core demo/preview component system with "Demo" and "Code" tabs is built from several interconnected files:
Renders the syntax-highlighted source code shown in the "Code" tab. It:
Fetches demo or registry source via getDemoSource/getRegistrySource
Formats code with formatCode and highlights with highlightCode
Renders a <figure> with optional <figcaption> title, a <CopyButton>, and highlighted HTML
Can be collapsible or non-collapsible
4. /home/himmel/personal/prsui/mdx-components.tsx
Registers ComponentPreview as an MDX component (line 41), making it available in .mdx documentation pages. Also registers supporting components like Tabs, TabsList, TabsTrigger, TabsContent, CodeTabs, ComponentSource, etc.
A separate tabs component used for installation command switching (npm/yarn/pnpm/bun), not the Demo/Code toggle. Uses the useConfig hook to persist the selected installation type.