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.
Installation
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.
Where do the links go?
Read the quickstart is the one main action, a Shine Button: a band of light sweeps across it once when the pointer arrives or it takes focus. Star on GitHub is the second action, an outline button that opens your repository in a new tab and tells screen readers so. The pill is a link (href="#") too: point it at your repository, and the quickstart at your documentation.
The Shine Button renders the link it's given with render, with nativeButton={false}.
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.
Related
- Pro
Terminal Copy Command Hero
Code and terminalA 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
Split Layout Terminal Install Hero
Code and terminalA 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
Install Command Snippet Hero
Code and terminalA 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 terminalA 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 proofA 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
Concentric Rings Hero
BackdropsA 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.