Three features with icons, centred, with no heading.

Last updated

Open block
Show code
---
/**
 * Simple icons 01: Three features with icons, centred, with no heading.
 *
 * @block features
 * @order 5
 */
import { ChartLine, Command, MessageCircle, MessageCircleHeart, MessagesSquare, Zap } from '@lucide/astro'
import Section from '@/components/apogee/Section/Section.astro'
import Heading from '@/components/apogee/Heading/Heading.astro'
import FeaturedIcon from '@/components/apogee/FeaturedIcon/FeaturedIcon.astro'
import type { FeaturesContent } from '@/components/apogee/sections/_shared/features.ts'

const icons = [MessagesSquare, Zap, ChartLine, MessageCircle, Command, MessageCircleHeart]

/** @composable */
interface Props extends FeaturesContent {}

const {
  label = 'Features',
  items = [
    { title: 'Share team inboxes', description: 'Whether your team is 2 people or 200, shared inboxes keep everyone on the same page and in the loop.' },
    { title: 'Deliver instant answers', description: 'One place for support, so customers get what they need without waiting on a reply.' },
    { title: 'Manage your team with reports', description: 'Measure what matters. Filter, export and drill down on the data in a couple of clicks.' },
  ],
} = Astro.props
---

<Section spacing="large">
  {/* The block has no visible heading; this one keeps the items one level under it. */}
  <h2 class="sr-only">{label}</h2>
  <ul class="grid list-none p-0 gap-x-8 gap-y-10 md:gap-y-16 sm:grid-cols-2 lg:grid-cols-3 ">
    {items.map((f, i) => { const Icon = icons[i % icons.length]!; return (
      <li class="flex flex-col items-center gap-4 text-center">
        <FeaturedIcon theme="outline" color="neutral" size="large"><Icon /></FeaturedIcon>
          <div class="flex flex-col gap-2">
            <Heading as="h3" size="h6">{f.title}</Heading>
            <p class="text-neutral-faded">{f.description}</p>
          </div>
      </li>
    )})}
  </ul>
</Section>

Add

npx @ava-ui/apogee add features/simple-icons-01

This copies the block to src/components/apogee/blocks/features/ with everything it uses: FeaturedIcon, Heading, Section. Every piece of copy is a prop, with the sample copy as its default. Pass yours, or null to hide a part; see copy is props.

Accessibility

  • The heading is an h2 by default, so the block slots into a page under its h1; item titles are one level down.
  • Each integration icon is an image named after the tool.