Code

Displays code inline in text.

It implements the <code> element.

Styles

Import the styles within a Next.js custom app in pages/_app.js.
import "device-agnostic-ui/Code.css";

Props

Use any valid <code> props.

Examples

How to import.
import Code from "device-agnostic-ui/Code.mjs";
Non-HTML code.
import Code from "device-agnostic-ui/Code.mjs";

const result = <Code>window</Code>;
window
Code in a link.
import Code from "device-agnostic-ui/Code.mjs";
import LinkText from "device-agnostic-ui/LinkText.mjs";

const result = (
  <LinkText href="https://developer.mozilla.org/en-US/docs/Web/API/Window">
    <Code>window</Code>
  </LinkText>
);
HTML code.
import Code from "device-agnostic-ui/Code.mjs";

const result = <Code>{"<strong>"}</Code>;
<strong>

Tags