DocsGetting StartedMDXComponents

Components

Mastering components in your MDX files

Components are automatically injected, without the need for manual import, into all MDX files. This means you can use any component that is available!

To learn more about, add or change the available components, see the file src/components/docs/mdx.tsx

Accordion

Example:

Code:

<Accordion type="multiple">
  <AccordionItem value="faq-1">
    <AccordionTrigger>
      Id qui enim sunt do sit ut ex voluptate consequat sint aliqua.
    </AccordionTrigger>
 
    <AccordionContent>
      Aliqua et adipisicing sunt anim adipisicing nostrud nostrud veniam aliquip ea. Aute fugiat incididunt laboris ullamco et voluptate fugiat fugiat sunt. Consectetur commodo sint exercitation esse consectetur deserunt ipsum sunt minim ea ipsum aliqua ad. Veniam velit dolore commodo officia ex ullamco fugiat occaecat minim excepteur incididunt officia. Sit irure eiusmod officia esse pariatur sint elit commodo. Ullamco ea eu labore duis dolore quis dolor eiusmod in minim culpa proident. Est magna dolor id elit.
 
      Velit dolore quis veniam ex aliqua. Et velit occaecat ea aliquip id quis voluptate ipsum culpa eu enim quis amet tempor. Minim cillum deserunt quis consequat esse eu irure sunt dolore nisi dolor sit adipisicing. Dolor aliqua nulla sit culpa incididunt magna commodo voluptate qui labore cillum consequat consequat.
    </AccordionContent>
  </AccordionItem>
 
  <AccordionItem value="faq-2">
    <AccordionTrigger>
      Esse aute exercitation amet irure incididunt fugiat sint cupidatat culpa dolore duis officia aliquip.
    </AccordionTrigger>
 
    <AccordionContent>
      Eiusmod labore eu eu eu reprehenderit aute anim duis labore nisi laborum magna enim.
    </AccordionContent>
  </AccordionItem>
</Accordion>

Alerts

Example:

Code:

<Alert className="my-4">
  <AlertTitle>Default alert</AlertTitle>
 
  <AlertDescription>
    This is a default alert.
  </AlertDescription>
</Alert>
 
<Alert variant="warning">
  <AlertTitle>Warning alert</AlertTitle>
 
  <AlertDescription>
    This is a warning alert.
  </AlertDescription>
</Alert>
 
<Alert variant="destructive" className="my-4">
  <AlertTitle>Error alert</AlertTitle>
 
  <AlertDescription>
    This is an error alert.
  </AlertDescription>
</Alert>

Tabs

Example:

Tab 1 content

Code:

<Tabs defaultValue="tab-1">
  <TabsList>
    <TabsTrigger value="tab-1">Tab 1</TabsTrigger>
    <TabsTrigger value="tab-2">Tab 2</TabsTrigger>
  </TabsList>
 
  <TabsContent value="tab-1">
    Tab 1 content
  </TabsContent>
 
  <TabsContent value="tab-2">
    Tab 2 content
  </TabsContent>
</Tabs>

Steps

Example:

Step 1:

npx something

Step 2:

npx something-else

Code:

<Steps>
  <Step>Step 1:</Step>
 
  ```bash
  npx something
  ```
 
  <Step>Step 2:</Step>
 
  ```bash
  npx something-else
  ```
</Steps>