You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---
title: Month Slider
description: Intuitive component that allows users to seamlessly select and navigate through months using a sliding interface, ideal for calendars, scheduling, and financial tracking.
---import { MonthSlider } from"@/components/vibrant/month-slider.tsx"import { Badge } from"@/components/ui/badge.tsx"importLinkfrom"next/link"import { Terminal } from"lucide-react"import { Tabs, TabsContent, TabsList, TabsTrigger } from"@/components/ui/tabs"import { ComponentPreview } from"@/components/core/component-preview.tsx"import { ComponentSource } from"@/components/core/component-source.tsx"import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from"@/components/ui/card"
<h1className="font-bold text-3xl"> Month Slider </h1>
<h2className="text-slate-500 mt-1 text-lg">
Intuitive component that allows users to seamlessly select and navigate
through months using a sliding interface, ideal for calendars, scheduling, and
financial tracking.
</h2>
<TabsdefaultValue="preview"className="mt-8">
<TabsList>
<TabsTriggervalue="preview"className="w-32">
Preview
</TabsTrigger>
<TabsTriggervalue="source"className="w-32">
Code
</TabsTrigger>
</TabsList>
<TabsContentvalue="preview"className="pt-2">
<ComponentPreview>
<MonthSlider />
</ComponentPreview>
</TabsContent>
<TabsContentvalue="source">
<ComponentSourcesource="month-slider.tsx" />
</TabsContent>
</Tabs>
I display the MDX file from this component:
"use client"import{allComponents}from"@/.content-collections/generated"import{Button}from"@/components/ui/button"import{ArrowLeft,ArrowRight}from"lucide-react"import{notFound,useParams,useRouter}from"next/navigation"exportconstComponentDoc=()=>{constparams=useParams()constrouter=useRouter()// Find the component based on the slug from the URLconstcurrentIndex=allComponents.findIndex((post)=>post._meta.path===params.slug)constpost=allComponents[currentIndex]// Handle case where component is not foundif(!post){returnnotFound()}// Navigate to the next componentconstgoToNext=()=>{constnextIndex=currentIndex+1if(nextIndex<allComponents.length){router.push(`/docs/components/${allComponents[nextIndex]._meta.path}`)}}// Navigate to the previous componentconstgoToPrevious=()=>{constprevIndex=currentIndex-1if(prevIndex>=0){router.push(`/docs/components/${allComponents[prevIndex]._meta.path}`)}}return(<article><post.mdx/><divclassName="w-full flex justify-between mt-5"><div>{currentIndex>0&&(<Buttonvariant="outline"className="rounded-full"onClick={goToPrevious}><ArrowLeft/>
Previous
</Button>)}</div><div>{currentIndex<allComponents.length-1&&(<Buttonvariant="outline"className="rounded-full"onClick={goToNext}>
Next
<ArrowRight/></Button>)}</div></div></article>)}
I noticed that the title and description are considered as a part of the body:
The text was updated successfully, but these errors were encountered:
This is not a problem of Content Collections. You are using next-mdx to render your mdx, which seems not to remove the frontmatter. Please check the configuration section of the next-mdx-static-import, which configures two remark plugins to remove the frontmatter.
Hi @sdorra ,
I have this content collection configuration:
I have this MDX file:
I display the MDX file from this component:
I noticed that the title and description are considered as a part of the body:
The text was updated successfully, but these errors were encountered: