shadcn.io is not affiliated with official shadcn/ui
Alternating Code Block Rows Features Block for React Aria
Three alternating bands for a typed event-stream client, each pairing a sentence with a code window that draws a different artifact: a call with its autocomplete popover, a config file with one line marked, and a command's output.
Installation
Overview
A features section for React with React Aria that sells a developer product with its own code. Three bands share one page column: a badge, a heading, a sentence and a text link on one side, and a code window in a hairline frame with + marks on its corners on the other. The sides swap row by row, and each window draws a different artifact: a typed call with an autocomplete popover under the caret, a config file with one marked line, and a command's output in a terminal. The code follows your theme in two weights of text, with no syntax colours and no forced dark window. The page's rails and top rule come from the Guides spine, and each band's rule is drawn by Guides too, so the marks land on it. For SDKs, APIs and developer tools where a few lines of code do more selling than a screenshot.
FAQ
How do I put in my own code?
Edit the line lists at the top of the file: CALL_LINES, CONFIG_LINES and OUTPUT_LINES. Each line is a string, and the text between two tildes is drawn in the strong weight while the rest stays quiet. Set marked on a line to tint it and rule its start, as in the config window. Keep a line under about 40 characters so it fits a phone without clipping.
Can I use a syntax highlighter instead?
Yes. The windows are plain markup inside the frame, so replace the body of a window with the output of your highlighter. This block draws code as a picture of the product, so it is hidden from assistive technology; if the snippet is the content you want people to copy, render it as real text in a labelled region instead.
Where do the links go?
Each row ends in a text link (href="#"): point it at the matching docs page. The arrow slides on hover and mirrors in a right-to-left layout. Nothing on the page is a button, so there is no primary control and no Shine Button.
Does the code window follow my theme?
Yes. The window, its tinted body and the marked line use theme tokens only, so they are light on a light page and dark on a dark one, in any preset. The selected suggestion in the popover is the one element drawn in the foreground colour.