InlineCode sets a short piece of code, such as a command or a prop name, in the code font on a weak neutral tint with a thin border. It is a Text, so it can sit inside a paragraph. For longer code, use CodeBlock. See the web InlineCode page for the web version.
Outside a Text, InlineCode shows its rounded border and padding.
- InlineCode is a Text, not a Flex, so it takes Text props instead of Flex props.
- The web sets 80% of the surrounding text size. A nested Text cannot read its parent's size, so InlineCode uses the label-s size, which is what the web's code-s size uses.
- Inside another Text, React Native ignores the border, radius and padding. Only the tint shows. Used on its own, all of them show.
- The font is fonts.code from ThemeProvider, or the platform monospace font (Menlo on iOS, monospace on Android) when none is set.