Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Install Command Hero Block for React

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.

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 for an open-source library, framework or CLI, for React with Base UI. Between the page rails sit a star count pill, a headline, one supporting line, an install command in a row with its copy button, a Shine Button to the quickstart beside a GitHub star button with its count; and at the foot, flush with the end of the section, a band ruled with solid hairlines and + marks shows the repository's stars, forks and contributors in three cells. It's built from Announcement, Copy Button, Shine Button, GitHub Stars Button and Guides, with CSS transitions for the entrance and your theme's tokens for every colour, so the block is light on a light theme and dark on a dark one. For open-source projects, developer frameworks and CLI tools whose community is the proof.

FAQ

How do I change the install command?

Edit COMMAND at the top of the file: the row shows it and the Copy button copies exactly that string. The $ prompt before it is decoration: hidden from screen readers, left out of a copy, and skipped when someone selects the command by hand. A long command wraps inside the row on a narrow screen rather than overflowing it.

How do I show my repository and its real star count?

Set username and repo on GitHub Stars Button to your repository. It's given count, so it shows that number and never calls GitHub; leave count out and it asks GitHub's API once per page load, in the browser, and shows its label alone if that fails. The pill and the stats band are plain text: when you pass a count from your server or build, write it there too.

What happens when someone presses Copy?

The command goes to the clipboard, the copy icon turns into a check for three seconds, and screen readers hear "Copied" from a polite status inside the button, which is named "Copy the install command". When the browser refuses the clipboard, as on a page not served over HTTPS, a cross shows instead and they hear "Couldn't copy"; the command is still there to select.

How does it fit on a phone?

The headline steps down from text-5xl to text-4xl, the command wraps inside its row next to the Copy button, and the two buttons stack when the row is too narrow, both inside the first screen. The stats band keeps its three cells side by side with smaller figures, and each figure keeps its order in a right-to-left layout.

When should I use this hero instead of a terminal hero?

Use it when your community is the pitch: the star count, the stats band and the star button all say people use and back the project, and the install command is one line. When showing what the tool prints or does is the point, a terminal hero such as Dark Terminal Copy gives that output the room.

  • 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

    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.

  • 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

    Centered Tech Icon Row Hero

    Logos and social proof

    A showcase centered hero for an integrations story, with a headline, a sentence, a Shine Button and six tool tiles below on shared hairlines, each with what the product does with the tool.

  • Pro

    A compact, centred hero for a design tool on solid rails: concentric rings breathe behind a headline, a Shine Button and an outline button, over a ruled band of three stats.