Components · Code
Code
A readable code surface with optional language context, copy action, and overflow controls.
Anatomy
- 1
.code-rootCode block surface and clipping boundary. - 2
.code-headerLanguage, filename, and copy-action row. - 3
.code-titleLanguage or filename label. - 4
.code-contentScrollable Shiki-painted code content; syntax colors remain owned by Shiki. - 5
.code-copy-triggerCopy action placement; button appearance comes from the button recipe. - 6
.code-overflow-controlExpansion control layered over clipped code.
.button-root {
color: var(--md-sys-color-on-primary);
}When to use
Use a code surface for readable snippets that people may need to scan, copy, or expand without editing.