Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Install Command Snippet Hero Block for React

A compact centred hero for a web framework: an install command with a copy button, two calls to action and a band of three stats.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A compact centred hero built around one install command. A release link, a bold headline and a muted subtitle sit under the page's top rule; below them the command in a bordered row with a Copy button, then two calls to action (a Shine Button and an outline Button). The hero ends in a band of three stats whose cells share vertical hairlines, its rule running between the page's rails with + marks at both ends. It's written for Fenwick, a made-up web framework. It's built from Announcement, Copy Button, Guides, Shine Button, Button and Status, with CSS transitions for the entrance and your theme's tokens for every colour. For CLI tools, npm packages, developer SDKs, and any product where a single command gets people started.

FAQ

How do I change the install command?

Edit INSTALL_COMMAND at the top of the file. The row shows it and the Copy button copies exactly that string. The $ before it is drawn apart from the command: it can't be selected, screen readers skip it, and it never reaches the clipboard. For a second command, such as a cd into the new folder, add another row with its own Copy button rather than joining them with &&.

What happens when someone presses Copy?

The Copy button writes the command to the clipboard, swaps its icon for a check for three seconds, and tells screen readers "Copied". When the browser refuses (no clipboard permission, or a page not served over HTTPS) it shows a cross and says "Couldn't copy" instead. To count copies in your analytics, pass it onCopiedChange, which is called with true each time the check appears.

How do I change the stats?

Edit STATS: each has a value, written as it should read (2.4M, 612), and a label. They're a description list, so screen readers read each label with its value. Each value sits in a bdi so a sign or a suffix keeps its place in a right-to-left layout, and the dividers come from divide-x, which flips sides there too. The band's top rule is drawn by its own Guides with marks="top", so the + marks land exactly on it. Three fit side by side down to 320 px.

How are the lines drawn?

The section is the page's spine: solid side rails and a top rule with + marks. The stats are a band: a full-column row whose own rule and marks come from Guides with rules="top" and sides={false}, and whose bottom edge is the next block's top rule, so no line is drawn twice.

How does it fit on a phone?

The headline steps down from text-5xl to text-4xl, the buttons wrap when they don't fit side by side, and the command drops to text-xs. A command longer than the row wraps onto a second line instead of being cut off, so it can always be read in full beside its Copy button. The stats keep their three columns, their labels wrapping under the values. The Shine Button is on the first screen.

When should I use this hero instead of a code window?

Use this one when installing is the whole pitch: one command, one button, and proof that people use it. Use a code window hero, such as Dark Code Window, when what it's like to write code with your product is the point, and a terminal hero when you want to show the command's output too.

  • Pro

    Install Command Hero

    Code and terminal

    A compact centred hero for an open-source library with a star count pill, an install command to copy, a Shine Button, a GitHub star button and a ruled band of the repository's stats at the foot.

  • Pro

    A split hero for a project scaffolder: text with a Shine Button and three stats on a ruled row, and a terminal in a hairline frame that shows the install command with a copy button and what it set up.

  • Pro

    A compact reverse split hero for an SDK: a dark code window with a deploy call and its JSON response beside the headline, a copyable install command and a Shine Button, over a closing band of three ruled feature cells.

  • Pro

    Split Code Preview Hero

    Code and terminal

    A reverse split hero for a job-queue SDK: a code window in a hairline frame with a copy button, beside the headline, three checks and two calls to action.

  • Pro

    Code Window Hero

    Code and terminal

    A split hero for an API client generator on solid rails: a headline and a Shine Button beside a code window whose snippet comes in token by token, in a hairline frame with + marks.

  • Pro

    A showcase hero for a keyboard-first issue tracker: a centred headline and two calls to action over a command palette drawn in a hairline frame.