Guides
Package Manager Tabs
Convert package-manager commands into synced MDX tabs.
The proseflyComponents() integration enables package manager tabs so authors can
write one familiar command and let the docs render equivalent commands for
other package managers.
What Authors Write
Write a supported command in a shell code block:
```shnpm install @prosefly/astro-components```The transform renders tabs for pnpm, npm, yarn, and bun. The generated
commands keep the same package names and normalize install syntax for each
tool.
pnpm add @prosefly/astro-componentsnpm install @prosefly/astro-componentsyarn add @prosefly/astro-componentsbun add @prosefly/astro-componentsSupported Node Commands
npm installnpm install <packages>npm i <packages>npm add <packages>npm run <script>npm create <initializer>npx <command>npm dlx <command>
Install commands preserve package names and normalize dev-dependency flags for
each package manager. For example, npm install --save-dev typescript becomes
the matching pnpm add -D, yarn add -D, and bun add -d command.
Examples:
pnpm buildnpm run buildyarn buildbun buildpnpm dlx astro add mdxnpx astro add mdxyarn dlx astro add mdxbunx --bun astro add mdxSupported Python Commands
Python install commands render as pip, uv, poetry, and pdm tabs.
```shpip install prosefly```pip install proseflyuv add proseflypoetry add proseflypdm add proseflySupported forms include:
pip install <packages>python -m pip install <packages>python3 -m pip install <packages>uv pip install <packages>uv add <packages>poetry add <packages>pdm add <packages>
Standalone Astro Setup
If you are not using a Prosefly theme, register the shared integration in
astro.config.ts. Package manager tabs are enabled by default.
import { defineConfig } from 'astro/config';import proseflyComponents from '@prosefly/astro-components/integration';
export default defineConfig({ integrations: [proseflyComponents()],});The integration configures remarkPackageManagerTabs, which injects the
required Tabs and TabItem imports when it transforms a code block. Authors
do not need to import those components manually.
To keep the other integration features but disable this transform, set
markdown.packageManagerTabs to false.
proseflyComponents({ markdown: { packageManagerTabs: false },})Authoring Rules
-
Use a shell code fence.
The plugin transforms
sh,shell,bash,zsh,terminal, andconsoleblocks. It also handles code fences without a language. -
Keep prompts simple.
Lines may start with
$, and the prompt is preserved in each generated command. Other prompt formats remain normal code blocks. -
Keep each transformed block consistent.
A block can contain multiple commands, but they must belong to the same package-manager family. Do not mix Node and Python commands in the same code block.
-
Leave custom commands alone.
Unsupported commands remain normal code blocks. Use manual
Tabswhen the alternatives need custom wording.
Avoid double configuration
Dahlia and Lotus already register the shared integration. Adding another
proseflyComponents() instance can duplicate Markdown transforms and is rejected
during configuration.
Last updated Sep 1, 2026