HeroText
apps/www/src/sections/HeroText.astro · 39 lines · group Hero
HeroText — the first screen without a picture: title, pitch and buttons, centered. For a page that opens with words alone.
In the fleet
Not used by any site yet.
Samples 1
Frost alerts that arrive in timenot a forecast — a measurement
Set a threshold once and the alert finds you by SMS, e-mail or in the app, early enough to start the fans.
MDX of this sample
<HeroText
title="Frost alerts that arrive in time"
highlight="not a forecast — a measurement"
description="Set a threshold once and the alert finds you by SMS, e-mail or in the app, early enough to start the fans."
primaryText="Talk to us"
primaryHref="/contact/"
secondaryText="Coverage map"
secondaryHref="/coverage/"
/>Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| title | string | yes | ||
| highlight | string | accent line rendered in the brand gradient under the title | ||
| description | string | |||
| theme | 'light' | 'dark' | 'light' | ||
| primaryText | string | |||
| primaryHref | string | '#' | ||
| secondaryText | string | |||
| secondaryHref | string | '#' |
Source apps/www/src/sections/HeroText.astro @ gitt.one
---
/**
* HeroText — the first screen without a picture: title, pitch and buttons,
* centered. For a page that opens with words alone.
*/
import Button from './_Button.astro';
interface Props {
title: string;
/** accent line rendered in the brand gradient under the title */
highlight?: string;
description?: string;
theme?: 'light' | 'dark';
primaryText?: string;
primaryHref?: string;
secondaryText?: string;
secondaryHref?: string;
}
const { title, highlight, description, theme = 'light', primaryText, primaryHref = '#', secondaryText, secondaryHref = '#' } = Astro.props;
const dark = theme === 'dark';
---
<section class:list={['relative overflow-hidden px-4 py-16 sm:px-6 sm:py-24 lg:px-8', dark ? 'bg-stone-800 text-white' : 'bg-white text-gray-900']}>
<div class="mx-auto max-w-3xl text-center">
<h1 class="text-4xl font-extrabold tracking-tight sm:text-5xl lg:text-6xl">
{title}
{highlight && <span class:list={['block bg-gradient-to-r bg-clip-text text-transparent', dark ? 'from-primary-300 to-primary-alt-400' : 'from-primary-500 to-primary-alt-600']}>{highlight}</span>}
</h1>
{description && <p class:list={['mt-6 text-xl', dark ? 'text-primary-100' : 'text-gray-500']}>{description}</p>}
<slot />
{(primaryText || secondaryText) && (
<div class="mt-10 flex flex-wrap justify-center gap-4">
{primaryText && <Button href={primaryHref}>{primaryText}</Button>}
{secondaryText && <Button href={secondaryHref} kind="secondary" onDark={dark}>{secondaryText}</Button>}
</div>
)}
</div>
</section>Source links point to engine-astro@38c294d9. Samples are demo content: the components are the real ones, the copy and the pictures are made up.