InlineCode
A word of code inside a sentence: a function, a flag, a file name.
import { InlineCode } from '@sypnia/ui/react'
On this page
In a sentence
It keeps the machine face and wraps with the text.
Call db.from('orders') with the name of a table, then select() the columns you need.
Code
import { InlineCode } from '@sypnia/ui/react';
// A word of code inside a sentence: it keeps the machine face and never breaks the line of text.
export default function Sentence() {
return <p>Call <InlineCode>db.from('orders')</InlineCode> with the name of a table, then <InlineCode>select()</InlineCode> the columns you need.</p>;
} When to use it
Use it when
- Text mentions something the person types or reads in code.
Do not use it when
- It is a whole command: Snippet.
- It is several lines: CodeBlock.
For everyone
- It is a
codeelement, so screen readers can tell it apart.