Calm motion: animations on this site only fade, with no movement
Code tabs
One command in tabs for each package manager
Shows a command for pnpm, npm, yarn, and bun in tabs, with a copy button. If the reader picks a tab once, every block of the same group on the page follows. The choice also stays for the next visit. It is a code block with the tabs filled in.
Basic
1. Add the library:
pnpm add blessing-ui vue
2. Start the dev server. This block follows the choice above.
pnpm dev
Your own tabs, in their own group:
brew install ffmpeg
installadds packages, such asinstall="blessing-ui vue". Withdev, they go in as dev dependencies.runruns a script ofpackage.json, such asrun="dev".execruns a package once, withpnpm dlx,npx,yarn dlx, orbunx.managerssets the tabs and their order (default pnpm, npm, yarn, and bun).tabsputs your own tabs in place of the package managers, each with anameand thecode.- All the blocks with the same
group(defaultpackage-manager) show the same tab. The browser keeps the choice for the next visit. The stored choice comes back after the page loads, and the first tab shows until then. - The tabs, the keys, and the copy button are the ones of the code block.
Usage
ts
import { BlessCodeTabs } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
install | string | — | packages to add, for example `blessing-ui vue` |
dev | boolean | — | add them as dev dependencies |
run | string | — | a script of package.json to run, for example `dev` |
exec | string | — | a package to run once, for example `nuxi init app` |
tabs | BlessCodeFile[] | — | your own tabs in place of the package managers |
managers | BlessPackageManager[] | ["pnpm", "npm", "yarn", "bun"] | |
group | string | "package-manager" | tabs with the same group keep the same choice on the page and on the next visit |
label | string | "Command" |