Inline code

Use InlineCode to render a short inline code fragment.

import {InlineCode} from '@primer/react-brand'

Usage

Use inline code for short code fragments such as commands, filenames, API names, configuration keys and values.

Examples

Default

Loading

In a heading

Loading

Wrapping

InlineCode wraps by default to prevent long fragments from overflowing their container. Use wrap={false} only for slash commands that must remain together and have a low character count.

Loading

Component props

NameTypeDefaultDescription
wrapbooleantrueControls whether the code fragment can wrap.

InlineCode renders a native code element and accepts its standard HTML attributes.