1One file or snippet with line numbers, a filename, language label,
2optional caller-authored highlighting and a copy button.
3
4This is a component, not a page module. It has no section padding,
5heading, file tree or index navigation. Its height follows the code
6instead of reserving a 16:9 panel for five lines.
7
8## Use
9
10Pass a `file` with `name`, optional `language`, and required `lines`.
11Each line is a string or a `{ key, text }` pair; `key` draws in accent
12ink. Copying preserves the authored plain text and line breaks.
13
14Snippets can also carry the same optional `annotations` array as Code
15Panel files. Pass `annotations` on CodeSnippet to enable range context;
16it is off by default. The Context control demonstrates both states.
17See `docs/code-panel.md` for the range schema and interaction behavior.
18
19Use Code Panel instead when the reader needs a collection of files,
20a file tree and navigation below it. Snippet and collection are not
21variants of one catalogue entry: they are different composition levels.
22
23CodeSnippet and CodePanel share their internal renderer, so line
24numbers, copying, borders and typography do not drift between them.
25The same renderer serves embedded Fig Frame source views without
26dragging module chrome into the frame.
27
28## Rules
29
30Code, paths and language labels stay mono (R-01). Edges are square
31(R-03), authored case is preserved (R-09), and the component leaves
32page spacing and ground to its caller (R-08).