# Code block header customization The code block component exposes a flexible header API to adapt the header to your app UX: - Toggle header on/off - Show or hide built-in toolbar buttons (collapse, copy, expand, preview, font-size) - Replace the left/right header content via named slots (`header-left`, `header-right`) Slots - `header-left` — Replace the left side of the header - `header-right` — Replace the right side of the header - `loading` — Customize loading placeholder when streaming is disabled Examples Below are a few common examples. You can find the full set of examples in the project README; these are the most useful patterns to re-use in your app. Hide the header (simple) ```vue twoslash ``` Replace the default header using the `#header-left` and `#header-right` named slots ```vue twoslash ``` Custom loading placeholder (shown when `stream` is false and `loading` is true) ```vue twoslash ``` Events and notes - The component emits `copy` when the copy button is clicked (the copy text is supplied as the event payload). Use `@copy="onCopy"` to listen for it. - The component emits `previewCode` only when you attach a `@preview-code` listener; payload is `{ node, artifactType, artifactTitle, id }`. (Without a listener, the built-in preview overlay is available for HTML only.) - To hide a specific toolbar button set, use the boolean props `showCollapseButton`, `showCopyButton`, `showExpandButton`, `showPreviewButton`, `showFontSizeButtons`. - Use `showTooltips` to toggle header action tooltips globally for this block. - The `showHeader` prop controls whether the header is rendered at all. Try this — replace the header in a small example: ```vue twoslash ``` Troubleshooting If you run into style conflicts (for instance, Tailwind reset/utility rules changing the header's layout), see the main Troubleshooting page which covers Tailwind import ordering and quick fixes: `/guide/troubleshooting`.