--- title: "Code Block" description: "Allows you to render highlighted code snippets" component: true --- ## Usage --- ```tsx import { CodeBlock } from "@medusajs/ui" ``` ```tsx ``` ## API Reference --- ### CodeBlock This component is based on the `div` element and supports all props of this element. ### CodeBlock.Header This component is based on the `div` element and supports all props of this element. ### CodeBlock.Header.Meta This component is based on the `div` element and supports all props of this element. ### CodeBlock.Body This component is based on the `div` element and supports all props of this element. ## Examples --- ### Single snippet If you want to only show a code sample for one language or API, you can choose to hide the snippet labels: ### No Header You could also choose to omit the header entirely: ### No Line Numbers