Components

Code

A component used to display inline code, with ability to copy the content by a button.

Loading

Installation

pnpm dlx shadcn@latest add @toui/code

Examples

Copy Button

Loading

Variants

Loading

Sizes

Loading

API Reference

This component provides a flexible way to display inline code snippets with optional copy functionality.

Code

PropTypeDefault
variant enum default
size enum default
showCopyButton booleanfalse
copyText string
asChild booleanfalse
className string

Credits

We use cookies

We use cookies to ensure you get the best experience on our website. For more information on how we use cookies, please see our cookie policy.

By clicking Accept, you agree to our use of cookies.
Learn more.