To add the Code
component to your app:
1 2import { Code } from '@forge/react';
Code highlights short strings of code snippets inline with body text.
Name | Type | Required | Description |
---|---|---|---|
children | string | No | Content to be rendered in the inline code block. |
Formatted code can appear in a variety of contexts, increasing the legibility and contrasting it against default paragraph text.
Use inline code when you wish to highlight a short code snippet from the surrounding default text, such as when referencing variable names.
1 2const CodeDefaultExample = () => { return ( <Text> To start creating a changeset, run <Code>yarn changeset</Code>. Then you'll be prompted to select packages for release. </Text> ); };
Rate this page: