A Shiki based Vue Code Block Component ✨
npm install shiki-block-vue
Shiki Code Block is a Shiki based component that allows you to render code in any language and theme. It is highly customizable and supports both light and dark themes.
You can use Shiki Code Block with your favourite framework or library. Install it as shown below
``sh✨ Auto-detect
npx nypm install shiki-block-vue
Vue 3 Usage
Vue 3 Marquee uses shiki-code-block-vue. You can check it out here.
`js
import CodeBlock from 'shiki-block-vue'
const code = pnpm add shiki-block-vue
``js
`$3
`css
`Usage With A Shiki Transformer
Check out the shiki-transformer-copy-button.
Install the shiki-transformer-copy-button as shown below:
`bash
pnpm add @selemondev/shiki-transformer-copy-button
`$3
`js
import { transformerCopyButton } from '@selemondev/shiki-transformer-copy-button'
``js
,
copyIcon: data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3C/svg%3E,
})
]" />
`Props
| name | type | description |
|:-------------:|:-------------:|:-------------------------:|
| lang | BundledLanguage | The language for the provided code. |
| code |
string | The code snippet. |
| theme | BuiltinTheme | A theme object with light and dark` properties for dark and light mode support. |- Shiki - A beautiful yet powerful syntax highlighter.