Homelogologo
Sponsor

Code

Displays inline code or code snippets

Usage

Used to display inline code or short code snippets. It styles the default HTML <code> element using design tokens to ensure consistent typography and background highlights.

import { Code } from "@elemnts-ui/react";
<Code>npm install @elemnts-ui/react</Code>

Sizes

Use the size prop to change the font size and padding of the code block.

Variants

Use the variant prop to change the visual styling of the code block.

API Reference

PropTypeDefault
sizexs | sm | md | lg | xlmd
variantprimary | secondary | tertiary | surface | ghostprimary
iconOnlybooleanfalse
asChildbooleanundefined