Code Viewer
Syntax-highlighted code with line numbers, copy button and dark mode, powered by shiki.
Presets
Curated looks for c2-code-viewer. Open any card in the studio to start from it. The frame is --c2-code-viewer--* (background and color override the theme’s own), the file-name bar is __header, the copy button __copy, gutters __line-numbers, emphasised rows __line__highlighted, and with theme="css-variables" the token colours themselves are the __theme--* properties.
npm install
>npm run ui> npm install
>npm run ui> const hello = (name) =>
> `Hi, ${name}!`> const hello = (name) =>
> `Hi, ${name}!`> - "@c2n/expansion-panel": "0.0.4",
>+ "@c2n/details": "0.0.4",> const hello = (name) =>
> `Hi, ${name}!`> const hello = (name) =>
> `Hi, ${name}!`> const one = 1
>const two = 2
>const three = 3
>const four = 4
>const five = 5
>const six = 6
>const seven = 7> Style assigned title and copy-icon nodes directly. Use the header, title, body, and copy-button parts for viewer-owned layout and fallback controls.