Skip to content
Haze UI

Contact: methods and hours

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

pnpm dlx shadcn@latest add @haze/contact-methods
Open preview in a new tab
Liveno JavaScript

When to use

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

When not to use

  • Visitors should submit a message directly; use contact-split-form

Installation

Add the Haze registry to components.json once, then install Contact: methods and hours with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.

pnpm dlx shadcn@latest add @haze/contact-methods
First time? Registry and theme setup

1. Add to components.json:

{
  "registries": {
    "@haze": "http://localhost:4329/r/{name}.json"
  }
}

2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";

API reference

PropTypeDefaultDescription
idstring"contact-methods"Unique section ID prefix.
eyebrowstring"Contact"Label above the heading.
titlestringdemo headingContact section heading.
descriptionstringdemo copyIntroductory copy; the default marks the contact details as examples.
headingLevel1 | 2 | 32Section heading level; method titles use the next level.
methods{ icon: "email" | "location" | "hours"; label: string; value: string; detail: string; href?: string }[]3 example methodsContact details and optional destinations; replace the fictional examples.
classstring–Additional section classes.

Keyboard interactions

Tab, Enter
Open any contact links provided by the caller.

Accessibility

  • Each contact method has a text heading and value; icons are decorative.
  • A value is linked only when its destination is supplied.

Notes for AI

Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.

  • 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": "http://localhost:4329/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: http://localhost:4329/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.

Dependencies

  • npm: @lucide/astro
  • @haze/utils
  • @haze/theme (one-time setup)

Source · Original Haze UI work.

Catalog

↑↓ moveEnter openEsc close

Keyboard shortcuts

CtrlK
Command palette
/
Focus search
←↑→↓
Move between cards
jk
Next / previous card
ci
Copy code / install command (detail page)
[]
Previous / next entry
?
This help
Esc
Close dialog