PackageInstall
Renders a single install command in a daisyUI-themed code panel. Same prop surface as the legacy four-tab switcher; the multi-manager UI was removed when Publier settled on pnpm-as-PM, bun-as-runtime.
<PackageInstall> renders a single pnpm add command in a themed <pre> block. Use it whenever you’d otherwise hand-write a fenced bash block that says pnpm add foo — the component picks up daisyUI tokens so it stays visually consistent with the rest of your docs as themes change.
Production dependency
pnpm add @publier/shellimport { PackageInstall } from '@publier/shell/components';
<PackageInstall pkg="@publier/shell" />Renders pnpm add @publier/shell.
Dev dependency
pnpm add -D vitest<PackageInstall pkg="vitest" type="dev" />Renders pnpm add -D vitest.
Exec (one-off bunx)
bunx astro@latest<PackageInstall command="astro@latest" type="exec" />Renders bunx astro@latest. The Publier CLI itself is distributed as a native Rust binary via publier.net/install.sh, not via bunx — this prop is for packages that legitimately ship as one-off-runnable npm commands.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
pkg | string | — | Package name for type: 'prod' or 'dev'. |
type | 'prod' | 'dev' | 'exec' | 'prod' | Install style. |
command | string | — | Raw command (e.g. 'astro@latest') for type: 'exec'. Overrides pkg. |
syncKey | string | — | Deprecated. Accepted for back-compat with pre-1.8 pages; no longer drives any cross-instance state. |
Command shape
type | Output |
|---|---|
prod (default) | pnpm add \{pkg\} |
dev | pnpm add -D \{pkg\} |
exec | `bunx {command |
Behaviour
- Pure SSR — no runtime JavaScript, no hydration cost.
- The
<pre>body uses daisyUI tokens (bg-base-200,rounded-box,text-sm) so it tracks theme changes for free. - HTML-escapes
pkgandcommandbefore emission.
Related
- General-purpose tabbed code → Tabs & CodeGroup.
- Fenced code block features (titles, highlights, copy) → Code blocks.