| Do | Set the language prop to match the code content so syntax highlighting is accurate. Use "plaintext" when the language is unknown. |
| Do | Add a title when the code represents a file. It gives readers context and appears in the header bar alongside the copy button. |
| Do | Use Code for short inline references like function names or CLI flags, and CodeBlock for standalone multi-line snippets. |
| Don't | Enable line numbers on short snippets (under 5 lines) where they add clutter without helping navigation. |
| Don't | Nest a code block inside a scrollable container. Use the maxHeight prop instead, which handles overflow natively. |