# CodeBlock changelog Read the complete [LICENSE](https://snowui.dev/LICENSE) for the installed version before use. Reviewed against Chinese source SHA-256 `940522b46d7fa09dc8104b14f95082e5bfb9973b1164c2668c2dc412307bad3f`. For version differences, check the installed package as well. ### v1.8.2 (2026-10-23) - Keep at least 4 CSS px between single-line code and accessories, and between language labels and action groups in normal and full-screen modes, with larger preferred overrides compressing and restoring through the existing responsive protocol. Single-line mode uses Frame singleLine and a Fill content slot so responsive direction does not stack it and short code retains trailing alignment. Code, line-number annotations, scrolling, copy, formatting, and full-screen behavior remain unchanged. - 2026-09-28: Aligned Indicator with the shared hit-area and state appearance. Corner resizes both width and height by default; explicit single-axis settings still apply. - 2026-09-27: Added separate highlighting for text/plain/plaintext/txt. English identifiers and numbers reuse keyword pink; URLs reuse comment gray. Text after a URL is no longer mistaken for a comment. - 2026-09-21: Unified the usage guide, source property table, and Site / AI reading entry points. Documentation only; component behavior is unchanged. | Date | Version | Description | | --- | --- | --- | | 2026-09-18 | v1.8.0 | Added `horizontalScrollbarVisibility`, allowing the horizontal scrollbar to appear only on CodeBlock hover; it still remains visible on overflow by default. | | 2026-09-03 | v1.7.0 | Added `format`, enabled by default, to format display and copied content by language. Supports explicit disabling, async race protection, original-text fallback, and retention of the single-line variant. | | 2026-08-17 | v1.6.3 | Default, fullscreen, and `singleLine` modes now use the shared Overlay horizontal scrollbar. It stays visible and draggable on horizontal code overflow, restoring visible scrolling feedback after native scrollbars were hidden. | | 2026-08-15 | v1.6.2 | Internal `pre` / `code` explicitly use `border-box`, alongside existing padding, margin, and font resets, to isolate them from element-level rules in optional `snowui-base.css`. | | 2026-08-12 | v1.6.1 | `singleLine` padding, gap, and radius now match standard Input: 12px vertical, 16px horizontal, 8px gap, and 16px radius. | | 2026-08-12 | v1.6.0 | Added `variant="singleLine"`. It follows Input’s Leading / Content / Trailing three-slot layout, retains highlighting and copy, and removes language, line numbers, fullscreen, vertical scrolling, and height-resize structure. | | 2026-08-09 | v1.5.1 | After Button bare defaulted to 100%, built-in copy / expand actions explicitly use `emphasis="muted"` to retain the secondary-action appearance of 40% at rest → 100% on hover. | | 2026-07-30 | v1.5.0 | Fullscreen expand/collapse now uses shared-element `layout` transitions for actual position and size, without scaling code glyphs. Normal and fullscreen modes both honor `showLineNumbers`, eliminating a horizontal jump on the last exit frame. | | 2026-07-08 | v1.4.7 | The `pin-top-right` offset of the top action container changed from `--padding-2` (8px) to `--padding-3` (12px), consistent in normal and fullscreen modes. | | 2026-07-08 | v1.4.6 | Top copy / expand Buttons now use Button bare’s default 16×16 size. Removed CodeBlock-specific Button shell sizing; group gap changed to `--gap-2` (8px) with `--snowui-code-block-gap-override`. | | 2026-06-21 | v1.4.4 | Migrated the private bottom-right resize icon and pointer algorithm to the shared Indicator corner, reusing host hover, 1px→2px sizing, color, keyboard, and ARIA behavior. | | 2026-06-22 | v1.4.5 | Fixed the Indicator action effect subscribing to controlled height and destroying the drag session after its first pointermove writeback. Continuous pointer capture now matches the former CodeBlock and Textarea behavior. | | 2026-05-02 | v1.4.1 | Fullscreen expand/shrink now calls Frame controller shared-element FLIP layout transition, expanding from the normal position and shrinking back to it. | | 2026-05-01 | v1.4.0 | Default height now fits content up to 15 lines. Added a bottom-right draggable height handle and top/bottom scroll masks. | | 2026-05-01 | v1.3.6 | Added `showLanguage` to control the language label. Toolbar gaps changed to 8px between language and Button group and 4px between Buttons. | | 2026-05-01 | v1.3.5 | Button hover now matches Button `bare`: no background overlay, opacity 0.4 at rest and 1 on hover. | | 2026-05-01 | v1.3.4 | Button-area color standardized to `--black-40`; hover uses the specified `currentColor` overlay. | | 2026-05-01 | v1.3.3 | Added `visibleLines` to control the number of code lines in the default state; the gap between line numbers and code changed to `--gap-3` (12px). | | 2026-05-01 | v1.3.2 | Isolated internal `` from global `code` padding, margin, and font rules in `snowui-base.css`; typography is inherited uniformly from the root container. | | 2026-05-01 | v1.3.1 | Fixed line-box alignment between line-number and code columns and removed a leftover internal `font-family` setting. | | 2026-05-01 | v1.3.0 | Supports direct code children such as `code`. The external action slot changed to `as="trailing"` like Input; code font size / line height changed to `--text-12` / `--leading-12`. | | 2026-05-01 | v1.2.0 | The code area shows five lines by default and uses the shared floating scrollbar. Fullscreen exit reverses Frame `whileAppear`; the overall background is Background/2; syntax token colors are hard-coded into selectors. | | 2026-05-01 | v1.1.0 | Recreated the light Code block appearance from the Figma design. Added lightweight built-in syntax highlighting; code text no longer sets font size, line height, or font family. | | 2026-04-30 | v1.0.0 | Initial creation: code display, line numbers, copy, fullscreen expansion, and icon switching driven by Frame default motion. | [Component guide](https://snowui.dev/llms/en/components/code-block.md) · [Full reference](https://snowui.dev/llms/en/components/code-block/reference.md)