Typography
Code
Marks text to signify a short fragment of computer code.
Code marks a short fragment of computer code. It renders a native code element, which conveys
code semantics to assistive technology, and applies the theme's monospace code font.
Code: Basic
In context
Code is inline, so it inherits the surrounding size and stays on one line by default. Pass
lineClamp of 2 or more, or pass textWrap, when the content should wrap. Its neutral chip sets
its own text colour, so it stays readable on a solid background. Inside a pre code block, Code
draws no chip and takes the block's colour and metrics.
Code: In context
API
CodeProps also accepts compatible DOM and ARIA attributes and event handlers for its rendered element.