styledsea

Card

Use the Card component in your MDX documentation

Usage

Add it to your MDX components.

import { Card, Cards } from 'styledsea-docs-interface/components/card';
 
<MDX
  components={{
    Card,
    Cards,
  }}
/>;

See Markdown for usages.

Cards

The container of cards.

Card

Based on Next.js <Link />.

PropTypeDefault
icon
ReactNode
-
description
ReactNode
-
href
string
-
external
boolean
-

With Icons

import { HomeIcon } from 'lucide-react';
 
<Cards>
  <Card
    icon={<HomeIcon />}
    href="/"
    title="Home"
    description="Go back to home"
  />
</Cards>

Tree Shaking

If you're using Contentlayer, or other libraries for rendering MDX, ensure that tree shaking is working properly.

Most of the icon libraries support importing icons individually.

import HomeIcon from 'lucide-react/dist/esm/icons/home';

As a workaround, you can pass icons to MDX Components too.

import { HomeIcon } from 'lucide-react';
 
const components = {
  ...defaultComponents,
  HomeIcon,
};

Last updated on

On this page

Edit on GitHub