A left-aligned heading, line and search field on the brand colour.

Last updated

Open block
Show code
---
/**
 * Left search brand: A left-aligned heading, line and search field on the brand colour.
 *
 * @block header
 * @order 18
 */
import { Search as SearchIcon } from '@lucide/astro'
import Section from '@/components/apogee/Section/Section.astro'
import SectionHeader from '@/components/apogee/SectionHeader/SectionHeader.astro'
import Input from '@/components/apogee/Input/Input.astro'
import { plain } from '@/components/apogee/sections/_shared/spine.ts'
import type { PageHeaderContent } from '@/components/apogee/sections/_shared/header.ts'

/** @composable */
interface Props extends PageHeaderContent {}
const { eyebrow = 'Resources', heading = 'Support centre', description = 'Get help and support or learn how to use the newest features.' } = Astro.props
---

<Section spacing="large" background="primary">
  <div class="flex flex-col gap-8 md:gap-12 items-start">
    <SectionHeader eyebrow={eyebrow ?? undefined} heading={plain(heading)} description={description ?? undefined} headingLevel={1} size="large" background="primary" />
    <form method="get" role="search" class="w-full sm:w-80">
      <Input type="search" name="q" placeholder="Search" aria-label="Search the help centre" size="large"><SearchIcon slot="start" /></Input>
    </form>
  </div>
</Section>

Add

npx @ava-ui/apogee add header/left-search-brand

This copies the block to src/components/apogee/blocks/header/ with everything it uses: Input, Section, SectionHeader. 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 the page’s h1; the items below are one level down.
  • The search field has a name of its own.