Search
Search components and blocks
Code Block
A syntax-highlighted code surface with stable streaming updates, line numbers, focused lines, smooth following, and copy feedback.
TSXagent/greet.tsGenerating
Install
$ pnpm dlx shadcn@latest add @ditherui/agent-code-block
Props
PropTypeDefault
codestring—langstring"tsx"filenamestring—focusedLinesnumber[]—streamingbooleanfalseclassNamestring—When to use the code block
Use the code block to show code with highlighting. It handles streaming updates, line numbers, focused lines and copy feedback.
Open the CLI tab on any preview above for the exact shadcn command. The source is copied into your project, so you can edit it like any other file.