bun add @rehype-pretty/transformers
pnpm add @rehype-pretty/transformers
npm install @rehype-pretty/transformers
yarn add @rehype-pretty/transformers
npx jsr add @rehype-pretty/transformers
You can use this as a shiki
transformer in rehype-pretty-code
by passing it to the transformers
array.
visibility
: 'always' | 'hover'
(default: 'hover'
)
feedbackDuration
: number
(default: 3_000
)
copyIcon
: string
(default: an inline SVG of a copy icon)
successIcon
: string
(default: an inline SVG of a green checkmark icon)
jsx
?: boolean
(default: false
) (required for React-based usage)
To use this with React, you need to import the registerCopyButton
function and call it in your the outermost client component.
Next.js example: