Astro Components
Type to search documentation.

Installation

Install the package for Lotus or a standalone Astro site.

Install the package where your MDX content is rendered. Lotus users can usually start importing components immediately. Standalone Astro users can also enable the icon integration, package-manager tabs, and image galleries.

Install

Terminal window
pnpm add @prosefly/astro-components

Use In MDX

Standalone Astro projects need MDX configured before they can render component imports inside .mdx files. If the project already renders MDX pages, or if it uses Lotus, skip this setup.

astro.config.ts
import mdx from '@astrojs/mdx';
import { defineConfig } from 'astro/config';
export default defineConfig({
integrations: [mdx()],
});
src/content/docs/getting-started.mdx
import { Callout, Steps } from '@prosefly/astro-components';
<Callout type="tip" title="Keep examples close to the task">
Import only the components used by the current page.
</Callout>
<Steps>
1. Install the package.
2. Import the component.
3. Write normal Markdown inside the component.
</Steps>

Configure Optional Features

  1. Add icon preloading if you use icons outside Lotus.

    astro.config.ts
    import { defineConfig } from 'astro/config';
    import proseflyIcon from '@prosefly/astro-components/icon';
    export default defineConfig({
    integrations: [
    proseflyIcon({
    preload: ['lucide:sparkles', 'simple-icons:github'],
    }),
    ],
    });
  2. Add markdown transforms if you want automatic tabs or galleries.

    astro.config.ts
    import { defineConfig } from 'astro/config';
    import {
    rehypeImageGallery,
    remarkPackageManagerTabs,
    } from '@prosefly/astro-components/markdown';
    export default defineConfig({
    markdown: {
    remarkPlugins: [remarkPackageManagerTabs],
    rehypePlugins: [rehypeImageGallery],
    },
    });
  3. Set theme tokens in the layout.

    Components have fallbacks, but a site-level token set keeps them visually aligned with the surrounding docs.

For detailed setup, see Package Manager Tabs and Images.

Import Paths

Use the main entry for components:

import { Callout, Card, Tabs } from '@prosefly/astro-components';

Use subpath entries for integrations:

import proseflyIcon from '@prosefly/astro-components/icon';
import { rehypeImageGallery } from '@prosefly/astro-components/markdown';

Component Exports

  • AccordionItem and Accordions
  • Badge
  • Callout
  • Card and CardGrid
  • FileTree
  • Icon
  • Steps
  • TabItem and Tabs

Last updated Jul 18, 2026