✨ Publier v1 is live — a polished docs platform built for the open web.
Skip to content

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/shell
import { 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

PropTypeDefaultDescription
pkgstringPackage name for type: 'prod' or 'dev'.
type'prod' | 'dev' | 'exec''prod'Install style.
commandstringRaw command (e.g. 'astro@latest') for type: 'exec'. Overrides pkg.
syncKeystringDeprecated. Accepted for back-compat with pre-1.8 pages; no longer drives any cross-instance state.

Command shape

typeOutput
prod (default)pnpm add \{pkg\}
devpnpm 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 pkg and command before emission.