FeatureItem
apps/www/src/sections/FeatureItem.astro · 57 lines · group Features & lists
In the fleet
Used on 1 site built with this engine.
Samples 1
<FeatureSection>MDX of this sample
<FeatureSection>
<FeatureItem
title="Own the readings, not a subscription to them"
description="Export the season as CSV, hand it to your agronomist, or pipe it into the tools you already run. Nothing is locked behind our dashboard."
imgPath="photo-05.jpg"
linkText="Read the API docs"
linkPath="/api/"
/>
</FeatureSection>Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| title | string | yes | ||
| description | string | yes | ||
| btnText | string | yes | ||
| btnPath | string | yes | ||
| imgPath | string | yes |
Source apps/www/src/sections/FeatureItem.astro @ gitt.one
---
import { Image } from 'astro:assets';
import Inbox from 'astro-heroicons/outline/Inbox.astro';
import { resolveImage } from '../lib/images';
interface Props {
title: string;
description: string;
btnText: string;
btnPath: string;
imgPath: string;
}
const { title, description, btnText, btnPath, imgPath } = Astro.props;
const image = await resolveImage(imgPath);
---
<div class="relative">
<div class="lg:mx-auto lg:max-w-7xl lg:px-8 lg:grid lg:grid-cols-2 lg:grid-flow-col-dense lg:gap-24">
<div class="px-4 max-w-xl mx-auto sm:px-6 lg:py-16 lg:max-w-none lg:mx-0 lg:px-0">
<div>
<div>
<span class="h-12 w-12 rounded-md flex items-center justify-center bg-gradient-to-r from-primary-600 to-primary-alt-700">
<Inbox class="h-6 w-6 text-white" aria-hidden="true" />
</span>
</div>
<div class="mt-6">
<h2 class="text-3xl font-extrabold tracking-tight text-gray-900">{title}</h2>
<p class="mt-4 text-lg text-gray-500">{description}</p>
<div class="mt-6">
<a
href={btnPath}
class="inline-flex bg-gradient-to-r from-primary-600 to-primary-alt-700 bg-origin-border px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white hover:from-primary-700 hover:to-primary-800"
>
{btnText}
</a>
</div>
</div>
</div>
</div>
<div class="mt-12 sm:mt-16 lg:mt-0">
{/* the image deliberately bleeds past the container; on ultra-wide
viewports the page grows visible side margins and the bleed reads as
a mistake, so from 2560px the image is cropped to its own column */}
<div class="pl-4 -mr-48 sm:pl-6 md:-mr-16 lg:px-0 lg:m-0 lg:relative lg:h-full">
<Image
src={image}
alt={title}
widths={[400, 840]}
class="w-full rounded-xl shadow-xl ring-1 ring-black/5 lg:absolute lg:left-0 lg:h-full lg:w-auto lg:max-w-none boxed:max-w-full boxed:object-cover"
/>
</div>
</div>
</div>
</div>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.
