--- /** * An install command with npm / pnpm / yarn tabs and a copy button. * All install commands on the page switch together. * * → npm install jimp * */ interface Props { pkg?: string; } const { pkg = "jimp" } = Astro.props; const managers = [ ["npm", "install"], ["pnpm", "add"], ["yarn", "add"], ] as const; --- { managers.map(([pm, verb], i) => ( {pm} )) } npm install {pkg} Copy
npm install {pkg}