# Contact: methods and hours

> A set of contact methods with optional links, supporting details and icons.

- Kind: block · Category: Contact · Interactivity: native
- Install: `npx shadcn@latest add @haze/contact-methods`
- File: `src/components/haze/blocks/contact-methods.astro`
- npm dependencies: @lucide/astro
- Registry dependencies: @haze/utils
- Docs page: https://hazeui.com/blocks/contact-methods

## Use when
- Visitors need several ways to reach an organization
- Contact details and availability matter more than an on-page form

## Avoid when
- Visitors should submit a message directly; use contact-split-form

## Alternatives
- [contact-split-form](https://hazeui.com/blocks/contact-split-form.md)

## Props

| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| id | `string` | "contact-methods" | no | Unique section ID prefix. |
| eyebrow | `string` | "Contact" | no | Label above the heading. |
| title | `string` | demo heading | no | Contact section heading. |
| description | `string` | demo copy | no | Introductory copy; the default marks the contact details as examples. |
| headingLevel | `1 \| 2 \| 3` | 2 | no | Section heading level; method titles use the next level. |
| methods | `{ icon: "email" \| "location" \| "hours"; label: string; value: string; detail: string; href?: string }[]` | 3 example methods | no | Contact details and optional destinations; replace the fictional examples. |
| class | `string` |  | no | Additional section classes. |

## Accessibility
- Each contact method has a text heading and value; icons are decorative.
- A value is linked only when its destination is supplied.
- Key Tab, Enter: Open any contact links provided by the caller.

## Agent prompts

### Install and use

Install the Haze UI block "Contact: methods and hours" with `npx shadcn@latest add @haze/contact-methods`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import ContactMethods from "@/components/haze/blocks/contact-methods.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/contact-methods.md

### Customize with real content

Adapt the Haze contact-methods block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, description, headingLevel, methods, class. Keep the layout, the heading level rules and these accessibility details: Each contact method has a text heading and value; icons are decorative. A value is linked only when its destination is supplied. Do not add raw color classes; use the Haze tokens.

### Choose the right block

Before using contact-methods, check it fits: use it when visitors need several ways to reach an organization; contact details and availability matter more than an on-page form. Avoid it when visitors should submit a message directly; use contact-split-form. Alternatives: @haze/contact-split-form.

## Example requests that should lead here
- List email, location and opening hours in a contact section

## Source

```astro
---
import { Clock3, Mail, MapPin } from "@lucide/astro";
import { cn } from "../../../lib/haze/utils";

interface Props {
  id?: string;
  eyebrow?: string;
  title?: string;
  description?: string;
  headingLevel?: 1 | 2 | 3;
  methods?: { icon: "email" | "location" | "hours"; label: string; value: string; detail: string; href?: string }[];
  class?: string;
}

const icons = { email: Mail, location: MapPin, hours: Clock3 };
const {
  id = "contact-methods",
  eyebrow = "Contact",
  title = "Find the right way to reach us",
  description = "These example details show how to share a few helpful ways to get in touch.",
  headingLevel = 2,
  methods = [
    { icon: "email", label: "Email", value: "hello@example.com", detail: "For general questions and ideas." },
    { icon: "location", label: "Visit", value: "12 Market Street", detail: "Example address, Northport." },
    { icon: "hours", label: "Hours", value: "Monday to Friday", detail: "9:00 am–5:00 pm, local time." },
  ],
  class: className,
} = Astro.props;
const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel];
const ItemHeading = ({ 1: "h2", 2: "h3", 3: "h4" } as const)[headingLevel];
---

<section aria-labelledby={`${id}-title`} class={cn("bg-background px-6 py-20 sm:py-24", className)}>
  <div class="mx-auto max-w-6xl">
    <div class="max-w-2xl">
      <p class="text-[0.6875rem]/4 font-medium tracking-wider text-muted-foreground uppercase">{eyebrow}</p>
      <Heading id={`${id}-title`} class="mt-3 text-3xl/9 font-semibold tracking-tight text-balance text-foreground sm:text-4xl/11">{title}</Heading>
      <p class="mt-4 text-base/7 text-pretty text-muted-foreground">{description}</p>
    </div>
    <ul class="mt-12 grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
      {methods.map((method) => {
        const Icon = icons[method.icon];
        return <li class="rounded-xl border border-border bg-card p-6">
          <span class="flex size-10 items-center justify-center rounded-lg bg-foreground/5 text-foreground inset-ring inset-ring-frame"><Icon aria-hidden="true" class="size-5" /></span>
          <ItemHeading class="mt-6 text-sm/5 font-medium text-muted-foreground">{method.label}</ItemHeading>
          <p class="mt-2 text-base/6 font-semibold tracking-tight text-foreground">{method.href ? <a href={method.href} class="rounded-sm underline underline-offset-4 transition-colors duration-150 ease-snappy hover:text-foreground/80 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring">{method.value}</a> : method.value}</p>
          <p class="mt-2 text-sm/6 text-muted-foreground">{method.detail}</p>
        </li>;
      })}
    </ul>
  </div>
</section>
```
