Component

Code is used to display inline code snippets with appropriate formatting and semantic meaning.

View component changelog
preview
console.log('This is some code')
React
import Code from "@radui/ui/Code" const CodeExample = () => ( <div> <Code>console.log('This is some code')</Code> </div> )
  • Renders as semantic <code> HTML element
  • Pre-styled for code snippets with proper font and background
  • Supports custom colors and variants
  • Helps maintain consistent code styling across your UI

A component for displaying inline code snippets using the semantic <code> HTML element.

PropTypeDefault
children
ReactNode
--
customRootClass
string
''
variant
string
''
size
string
''
color
string
''