Hero
A visual lead block with expressive type, gradient object, and two deliberate actions.
Live preview
Adjust a setting to update the preview and usage code together.
Usage & source
import type { CSSProperties } from "react";
import { Hero } from "./components/stepkit/Hero";
import "./components/stepkit/styles.css";
const themeStyle = {"--stepkit-bg":"#f7f7f8","--stepkit-surface":"#ffffff","--stepkit-surface-muted":"#f0f0f3","--stepkit-fg":"#17181c","--stepkit-muted":"#626572","--stepkit-border":"#e3e4e9","--stepkit-border-strong":"#c8cad3","--stepkit-code":"#f1f1f4","--stepkit-shadow":"0 20px 60px rgba(31, 26, 64, .10)","--stepkit-accent":"#6950df","--stepkit-accent-strong":"#5137c7","--stepkit-accent-soft":"#eeeafd","--stepkit-accent-on-soft":"#5137c7","--stepkit-accent-text":"#ffffff","--stepkit-error":"#b43145","--stepkit-placeholder":"#626572","--stepkit-radius":"16px","--stepkit-space":"16px","--stepkit-control-height":"44px","--stepkit-font-sans":"Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif"} as CSSProperties;
export default function Example() {
return (
<div className="stepkit-theme" data-stepkit-preset="modern" style={themeStyle}>
<Hero
eyebrow={"Stepkit / expressive blocks"}
headline={"Build the next useful thing."}
body={"A composed block with a clear message and one deliberate action."}
ctaLabel={"Get started"}
/>
</div>
);
}Dependencies
[email protected] [email protected]
/*
* Stepkit 0.2.0
* Copyright (c) 2026 Vladislav Stepanov
*
* Original Stepkit portions in this release are licensed under the MIT License. Adapted portions identify their upstream licence and copyright in the copied source and in `NOTICE-MAGICUI.md` where applicable.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
"use client";
import { useId, type ReactNode } from "react";
import { Button, type ButtonVariant } from "./Button";
import "./styles.css";
export interface HeroProps {
eyebrow?: string;
headline?: string;
body?: string;
ctaLabel?: string;
ctaVariant?: ButtonVariant;
onCtaClick?: () => void;
secondaryLabel?: string;
onSecondaryClick?: () => void;
visual?: ReactNode;
className?: string;
}
export function Hero({ eyebrow = "Stepkit / expressive blocks", headline = "Build the next useful thing.", body = "A composed block with a clear message and one deliberate action.", ctaLabel = "Get started", ctaVariant = "solid", onCtaClick, secondaryLabel = "Explore the system", onSecondaryClick, visual, className = "" }: HeroProps) {
const headlineId = useId();
return (
<section className={`stepkit stepkit-hero${className ? ` ${className}` : ""}`} aria-labelledby={headlineId}>
<div className="stepkit-hero__content"><span className="stepkit-hero__eyebrow">{eyebrow}</span><h1 className="stepkit-hero__headline" id={headlineId}>{headline}</h1><p className="stepkit-hero__body">{body}</p><div className="stepkit-hero__actions"><Button label={ctaLabel} variant={ctaVariant} onClick={onCtaClick} />{secondaryLabel ? <Button label={secondaryLabel} variant="outline" onClick={onSecondaryClick} /> : null}</div></div>
<div className="stepkit-hero__visual">{visual ?? <div className="stepkit-hero__orb" aria-hidden="true" />}</div>
</section>
);
}
export default Hero;
components/Hero.tsxcomponents/Button.tsxcomponents/styles.cssInstall
Use the released registry entry or download the complete archive.
npx [email protected] add https://vstepanov.com/stepkit/r/hero.jsonIntegration prompt
Install Stepkit Hero 0.2.0 from the registry and preserve the included MIT notice. npx [email protected] add https://vstepanov.com/stepkit/v0.2.0/r/hero.json Install the tested runtime dependencies exactly: npm install [email protected] [email protected] Keep the component source, shared styles, NOTICE.md, and provenance files together. Apply the theme tokens on a wrapper rather than passing theme keys as component props. Usage: ```tsx import type { CSSProperties } from "react"; import { Hero } from "./components/stepkit/Hero"; import "./components/stepkit/styles.css"; const themeStyle = {"--stepkit-bg":"#f7f7f8","--stepkit-surface":"#ffffff","--stepkit-surface-muted":"#f0f0f3","--stepkit-fg":"#17181c","--stepkit-muted":"#626572","--stepkit-border":"#e3e4e9","--stepkit-border-strong":"#c8cad3","--stepkit-code":"#f1f1f4","--stepkit-shadow":"0 20px 60px rgba(31, 26, 64, .10)","--stepkit-accent":"#6950df","--stepkit-accent-strong":"#5137c7","--stepkit-accent-soft":"#eeeafd","--stepkit-accent-on-soft":"#5137c7","--stepkit-accent-text":"#ffffff","--stepkit-error":"#b43145","--stepkit-placeholder":"#626572","--stepkit-radius":"16px","--stepkit-space":"16px","--stepkit-control-height":"44px","--stepkit-font-sans":"Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif"} as CSSProperties; export default function Example() { return ( <div className="stepkit-theme" data-stepkit-preset="modern" style={themeStyle}> <Hero eyebrow={"Stepkit / expressive blocks"} headline={"Build the next useful thing."} body={"A composed block with a clear message and one deliberate action."} ctaLabel={"Get started"} /> </div> ); } ``` Selected bounded settings: {"eyebrow":"Stepkit / expressive blocks","headline":"Build the next useful thing.","body":"A composed block with a clear message and one deliberate action.","ctaLabel":"Get started"}. Selected theme: {"mode":"light","accent":"violet","radius":"soft","density":"comfortable","preset":"modern"}.
Props
| Name | Type | Default | Description |
|---|---|---|---|
eyebrow | string | "Stepkit / expressive blocks" | Context label. |
headline | string | "Build the next useful thing." | Primary heading. |
body | string | "A composed block with a clear message and one deliberate action." | Supporting copy. |
onCtaClick | () => void | undefined | Primary action callback. |
visual | ReactNode | undefined | Optional replacement visual. |
Accessibility & limits
- Uses a labelled section and one h1 heading.
- Both actions are native buttons with visible focus states.
Limitations
- The default visual is decorative; replace it with a product visual when composing.
Provenance
Original source under the MIT licence.
Original Stepkit implementation.
Required notices: NOTICE.md, PROVENANCE-stepkit-hero.md
- 3 source files in the release
- Version 0.2.0