Inline

Use npm install @davaux/ui to add the package to your project.

<p>Use <Code>npm install @davaux/ui</Code> to add the package.</p>

Block

import { Button } from '@davaux/ui'

export default function Page() {
  return <Button>Hello</Button>
}
<Code block>
  {`import { Button } from '@davaux/ui'

export default function Page() {
  return <Button>Hello</Button>
}`}
</Code>

Custom background color

blue backgroundgreen backgroundorange background
<Code color="var(--dv-color-blue-light)">blue background</Code>
<Code color="var(--dv-color-green-light)">green background</Code>

Props

PropTypeDefaultDescription
blockbooleanfalseRenders a block-level <pre><code> instead of inline
colorstringBackground color of the code element — any CSS color
classstringAdditional CSS class names
styleobjectInline styles
childrenReactNodeCode content to display