shadcn.io is not affiliated with official shadcn/ui
Split Layout Image Hero Block for React
A reverse split hero for an AI code assistant: an editor drawn from UI runs edge to edge to the start rail, with a file tree, code, a ghost suggestion and an assistant panel; a divider and the copy sit at the end.
Installation
Overview
A reverse split hero for Cairn, an AI code assistant, on drafting lines. The "image" is built from UI instead of a placeholder: an editor that runs edge to edge to the start rail, with a file tree, file tabs, numbered code, the assistant's next line as dashed ghost text with a Tab key to accept it, and a panel at the foot listing the files it read, its answer and an ask field. A solid divider separates it from the copy at the end: an announcement link, the headline, three checks and a Shine Button with an outline second action. The editor is drawn in your theme's greys, and its small buttons use foreground tones so the Shine Button stays the one primary action. For developer tools, AI products and any page where the product visual is the selling point.
FAQ
How do I replace the drawing with my screenshot?
Replace <Editor /> with an img that fills the cell (absolute inset-0 size-full object-cover) and give it alt text that says what the screenshot shows; take aria-hidden and inert off the cell. The cell keeps its height on wide screens from the copy beside it and is h-80 or h-96 below lg, so the page doesn't jump as it loads.
How do I change the code and the suggestion?
The code is CODE, then SUGGESTION, then CODE_AFTER: each line is a list of [text, tone] pairs where the tone (kw, fn, str or plain) sets its weight. FILES is the file tree and CONTEXT the files in the assistant's panel; ANSWER is its one sentence.
How is the divider drawn?
The copy's cell has a border-s with a + mark where it meets the section's top rule, from our Guides component; the editor runs to the column's start rail and the section's rails and top rule come from <Guides bleed marks="top" rules="top" />. Below lg the divider becomes a rule between the stacked parts.
How does a screen reader read the hero?
It reads the announcement link, the headline (the block's one h1), the paragraph, the checklist and the two links. The editor is decoration, so it's hidden from screen readers and marked inert; a real screenshot should be shown to them, with alt text. The copy comes first in the document and the editor is moved to the start only on wide screens.
How does the hero fit on a phone?
The parts stack below the lg breakpoint, copy first and the editor under it in a 20 rem band, its code fading out at the foot. Below sm the file tree, the Tab key and the assistant's panel are hidden so the code keeps the room. The Shine Button sits on the first screen.
Related
- Pro
Split Layout Browser Frame Hero
Product windowsA showcase hero with start-aligned copy, a band of three checklist cells and a browser window in a hairline frame showing a deployments list.
- Pro
Split Layout Video Player Hero
Mobile and mediaA reverse split hero for a deploy platform: a wide video whose poster is the product's own deploy screen over a ruled list of its chapters, beside the headline, a checklist and a Shine Button.
- Pro
Split Phone Frame Hero
Mobile and mediaA split hero for a mobile app: copy, store links and social proof beside a phone frame that slides out of a hairline frame, cut off at its foot.
- Pro
Split Layout Hover Cards Hero
Features and tablesA split hero for a deploy platform: an outline badge, the headline, one sentence and a Shine Button beside three linked feature cards that lift under the pointer, each in a cell with solid lines that run past its corners.
- Pro
Diagonal Split Showcase Hero
Stats and live dataA split hero cut on a diagonal between solid rails: a copy panel with a Shine Button slanting over a tinted panel of three live numbers, each with its own bar sparkline.
- Pro
Centered Browser Frame Hero
Product windowsA centered showcase hero over a full-width browser window showing the product, a logs explorer with a request histogram and a log, held by a hairline frame and faded below the fold.