Code component.
<P> We all know <Code>console.log()</Code> is the best way to debug.</P>
Here's the <Code />
component in action.
We all know console.log()
is the best way to debug.
import { forwardRef, type HTMLAttributes } from 'react'import { cn } from '#app/utils/tailwind-merge.ts'
/** * A Code component. */const Code = forwardRef<HTMLElement, HTMLAttributes<HTMLElement>>(({ className, ...props }, ref) => <code ref={ref} className={cn('code', className)} {...props} />)Code.displayName = 'Code'
export { Code }
:not(.pre) > .code { @apply bg-muted-200 text-muted-900 py-fluid-2 px-fluid-5 rounded-md;}