Composition and API
Pass a package name through the packageName prop (e.g. "react" or "@zentauri-ui/zentauri-components"). The component builds the install command for each package manager and renders tabs for npm, pnpm, yarn, and bun. defaultManager sets the initial active tab, enableClipboard toggles the copy button, and appearance/size control chrome and text scale. The separate animated entry adds a fade preset for the command block.
Accessibility
The copy control is a real button with accessible labeling. The package-manager tabs use proper aria roles and keyboard navigation. Each state change (copied, tab selected) is communicated to assistive technology. The animated entry's motion is short and easing-based, so pair it with prefers-reduced-motion handling in your app where needed.
Next.js integration notes
The static PackageInstallCommand entry ships no framer-motion and is safe in any Server or Client Component tree (it is a Client Component because the copy button manages local state). The animated PackageInstallCommandAnimated entry imports framer-motion, which is an optional peer dependency — install it only if you use the animated entry. Both render deterministically from the same command, so server and client output match and there is no hydration mismatch.
FAQ
How do I change the package manager that is selected by default?
Use the defaultManager prop to set the initial active tab. It accepts "npm", "pnpm", "yarn", or "bun".
Can I hide the package-manager tabs?
The tabs are always shown. There is no built-in prop to hide them. If you need a standalone copyable install command without tabs, compose the PackageInstallCommandTabs sub-component separately.
Do I need framer-motion?
Only for the animated entry. The default import from @zentauri-ui/zentauri-components/ui/package-install-command is framer-motion-free. Import PackageInstallCommandAnimated from the /animated subpath when you want the fade preset, and install framer-motion as a peer dependency.
How do I theme the command colors?
Override the --zui-package-install-command-* CSS variables (bg, fg, border, tab, copy-icon, and more) on :root, a theme selector, or a wrapper. Each variable ships a light fallback and a paired -dark variant for dark mode.