Hero: command
Hero built around one copyable command, such as an install line.
Preview
The command types itself, one character at a time, with a blinking caret. Screen readers and the copy button always get the full command. With reduced motion turned on, it renders the plain layout.
Install a section in one line
Then edit it like any other file in your project.
npx shadcn@latest add https://tapasui.tahmid.space/r/hero.jsonInstall a section in one line
Then edit it like any other file in your project.
npx shadcn@latest add https://tapasui.tahmid.space/r/hero.jsonInstallation
Run this in a project that already uses shadcn/ui. It adds the component and anything it needs; the motion version also adds the plain one and the motion package.
Usage
import { HeroCommand } from "@/components/custom/hero-command";
<HeroCommand
title="Install a section in one line"
command="npx shadcn@latest add https://example.com/r/hero.json"
primaryAction={{ label: "Read the docs", href: "/docs" }}
/>import { HeroCommandMotion } from "@/components/custom/hero-command/hero-command-motion";
<HeroCommandMotion
title="Install a section in one line"
command="npx shadcn@latest add https://example.com/r/hero.json"
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title* (required) | string | – | The headline, rendered as the page's h1. |
| eyebrow | string | – | Small badge above the title. |
| description | string | – | Supporting line under the title. |
| primaryAction | { label: string; href: string } | – | Filled button. |
| command* (required) | string | – | The command to show and copy. |
| copyLabel | string | "Copy command" | Accessible name of the copy button. |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
| Prop | Type | Default | Description |
|---|---|---|---|
| title* (required) | string | – | The headline, rendered as the page's h1. |
| eyebrow | string | – | Small badge above the title. |
| description | string | – | Supporting line under the title. |
| primaryAction | { label: string; href: string } | – | Filled button. |
| command* (required) | string | – | The command to show and copy. |
| copyLabel | string | "Copy command" | Accessible name of the copy button. |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
Accessibility
- The copy button announces “Copied” through a polite live region.
- The motion version follows the visitor's reduced-motion setting and never hides content before it animates.