Contact

Ways to reach the team beside a form of name, email and message, which thanks the visitor once sent.

Contact

Your headline goes here

A short line about how to reach the team goes here.

import { Contact, type ContactDetail } from "@produkto/ui/Contact";
import {
  Location01Icon,
  Mail01Icon,
  SmartPhone01Icon,
} from "@hugeicons/core-free-icons";
import { Icon } from "@produkto/ui/Icon";

const details: ContactDetail[] = [
  {
    icon: <Icon icon={Mail01Icon} />,
    label: "Email",
    value: "hello@example.com",
    link: "mailto:hello@example.com",
  },
  {
    icon: <Icon icon={SmartPhone01Icon} />,
    label: "Phone",
    value: "+00 000 000 000",
    link: "tel:+00000000000",
  },
  {
    icon: <Icon icon={Location01Icon} />,
    label: "Address",
    value: "Street name 1\n0000 City",
  },
];

const send = () => new Promise<void>((resolve) => setTimeout(resolve, 600));

const Example = () => (
  <Contact
    description="A short line about how to reach the team goes here."
    details={details}
    eyebrow="Contact"
    onSubmit={send}
    title="Your headline goes here"
  />
);

export default Example;

Usage

import {
  Contact,
  type ContactDetail,
  type ContactValues,
} from "@produkto/ui/Contact";
const details: ContactDetail[] = [
  {
    label: "Email",
    value: "hello@example.com",
    link: "mailto:hello@example.com",
  },
  { label: "Address", value: "Street name 1\n0000 City" },
];

const send = async (values: ContactValues) => {
  await fetch("/api/contact", { method: "POST", body: JSON.stringify(values) });
};

<Contact
  eyebrow="Contact"
  title="Your headline goes here"
  description="A short line about how to reach the team goes here."
  details={details}
  onSubmit={send}
/>

Examples

Details and map

map sets the details and the opening hours beside a map.

Contact

Your headline goes here

A short line about how to reach the team goes here.

Label

Mon to Fri
09:00 to 18:00
Sat
10:00 to 16:00
Sun
Closed
import {
  Contact,
  type ContactDetail,
  type ContactHours,
} from "@produkto/ui/Contact";
import {
  Call02Icon,
  Location01Icon,
  MapsIcon,
} from "@hugeicons/core-free-icons";
import { Icon } from "@produkto/ui/Icon";

const details: ContactDetail[] = [
  {
    label: "Label",
    value: "Content goes here.",
    icon: <Icon icon={Location01Icon} />,
  },
  {
    label: "Label",
    value: "+1 (555) 123-4567",
    link: "tel:+15551234567",
    icon: <Icon icon={Call02Icon} />,
  },
];

const hours: ContactHours = {
  title: "Label",
  rows: [
    { days: "Mon to Fri", time: "09:00 to 18:00", today: true },
    { days: "Sat", time: "10:00 to 16:00" },
    { days: "Sun", time: "Closed" },
  ],
};

const Example = () => (
  <Contact
    description="A short line about how to reach the team goes here."
    details={details}
    eyebrow="Contact"
    hours={hours}
    map={
      <div className="flex items-center justify-center text-muted-foreground">
        <Icon icon={MapsIcon} size={32} />
      </div>
    }
    title="Your headline goes here"
  />
);

export default Example;

Map first

mapFirst sets the map before the details from a laptop up.

Contact

Your headline goes here

A short line about how to reach the team goes here.

Label

Mon to Fri
09:00 to 18:00
Sat
10:00 to 16:00
Sun
Closed
import {
  Contact,
  type ContactDetail,
  type ContactHours,
} from "@produkto/ui/Contact";
import {
  Call02Icon,
  Location01Icon,
  MapsIcon,
} from "@hugeicons/core-free-icons";
import { Icon } from "@produkto/ui/Icon";

const details: ContactDetail[] = [
  {
    label: "Label",
    value: "Content goes here.",
    icon: <Icon icon={Location01Icon} />,
  },
  {
    label: "Label",
    value: "+1 (555) 123-4567",
    link: "tel:+15551234567",
    icon: <Icon icon={Call02Icon} />,
  },
];

const hours: ContactHours = {
  title: "Label",
  rows: [
    { days: "Mon to Fri", time: "09:00 to 18:00", today: true },
    { days: "Sat", time: "10:00 to 16:00" },
    { days: "Sun", time: "Closed" },
  ],
};

const Example = () => (
  <Contact
    description="A short line about how to reach the team goes here."
    details={details}
    eyebrow="Contact"
    hours={hours}
    map={
      <div className="flex items-center justify-center text-muted-foreground">
        <Icon icon={MapsIcon} size={32} />
      </div>
    }
    mapFirst
    title="Your headline goes here"
  />
);

export default Example;

Three ways

A detail's action ends its card with a link, so calling, writing and visiting stand side by side.

Contact

Your headline goes here

A short line about how to reach the team goes here.

  • Label

    +1 (555) 123-4567

    Link
  • Label

    Content goes here.

    Link
  • Label

    Content goes here.

    Link
import { Contact, type ContactDetail } from "@produkto/ui/Contact";
import {
  BubbleChatIcon,
  Call02Icon,
  Location01Icon,
} from "@hugeicons/core-free-icons";
import { Icon } from "@produkto/ui/Icon";

const details: ContactDetail[] = [
  {
    label: "Label",
    value: "+1 (555) 123-4567",
    icon: <Icon icon={Call02Icon} />,
    action: { label: "Link", link: "#" },
  },
  {
    label: "Label",
    value: "Content goes here.",
    icon: <Icon icon={BubbleChatIcon} />,
    action: { label: "Link", link: "#" },
  },
  {
    label: "Label",
    value: "Content goes here.",
    icon: <Icon icon={Location01Icon} />,
    action: { label: "Link", link: "#" },
  },
];

const Example = () => (
  <Contact
    description="A short line about how to reach the team goes here."
    details={details}
    eyebrow="Contact"
    title="Your headline goes here"
  />
);

export default Example;

Opening hours

hours with no map sets the week on a card beside the details, today in bold, and status a sign over them.

Contact

Your headline goes here

A short line about how to reach the team goes here.

Open now

Label

Mon to Fri
09:00 to 18:00
Sat
10:00 to 16:00
Sun
Closed
import {
  Contact,
  type ContactDetail,
  type ContactHours,
} from "@produkto/ui/Contact";
import { Call02Icon, Location01Icon } from "@hugeicons/core-free-icons";
import { Icon } from "@produkto/ui/Icon";

const details: ContactDetail[] = [
  {
    label: "Label",
    value: "Content goes here.",
    icon: <Icon icon={Location01Icon} />,
  },
  {
    label: "Label",
    value: "+1 (555) 123-4567",
    link: "tel:+15551234567",
    icon: <Icon icon={Call02Icon} />,
  },
];

const hours: ContactHours = {
  title: "Label",
  rows: [
    { days: "Mon to Fri", time: "09:00 to 18:00", today: true },
    { days: "Sat", time: "10:00 to 16:00" },
    { days: "Sun", time: "Closed" },
  ],
};

const Example = () => (
  <Contact
    description="A short line about how to reach the team goes here."
    details={details}
    eyebrow="Contact"
    hours={hours}
    status="Open now"
    title="Your headline goes here"
  />
);

export default Example;

Several locations

locations sets each place on a card, its map over its name, its address and its phone.

Contact

Your headline goes here

A short line about the places goes here.

import { Contact, type ContactLocation } from "@produkto/ui/Contact";
import {
  Call02Icon,
  Location01Icon,
  MapsIcon,
} from "@hugeicons/core-free-icons";
import { Icon } from "@produkto/ui/Icon";

const map = (
  <div className="flex items-center justify-center text-muted-foreground">
    <Icon icon={MapsIcon} size={32} />
  </div>
);

const locations: ContactLocation[] = ["Place 1", "Place 2", "Place 3"].map(
  (name) => ({
    name,
    map,
    details: [
      {
        label: "Label",
        value: "Content goes here.",
        icon: <Icon icon={Location01Icon} />,
      },
      {
        label: "Label",
        value: "+1 (555) 123-4567",
        link: "tel:+15551234567",
        icon: <Icon icon={Call02Icon} />,
      },
    ],
  }),
);

const Example = () => (
  <Contact
    description="A short line about the places goes here."
    eyebrow="Contact"
    locations={locations}
    title="Your headline goes here"
  />
);

export default Example;

Form alone

onSubmit alone gives the heading and the form; it is called with the name, email and message.

Contact

Your headline goes here

A short line about how to reach the team goes here.

import { Contact } from "@produkto/ui/Contact";

const send = () => new Promise<void>((resolve) => setTimeout(resolve, 600));

const Example = () => (
  <Contact
    description="A short line about how to reach the team goes here."
    eyebrow="Contact"
    onSubmit={send}
    title="Your headline goes here"
  />
);

export default Example;

Details alone

Without onSubmit there is no form, and the details lie in a row of cards.

Contact

Your headline goes here

A short line about how to reach the team goes here.

import { Contact, type ContactDetail } from "@produkto/ui/Contact";
import {
  Location01Icon,
  Mail01Icon,
  SmartPhone01Icon,
} from "@hugeicons/core-free-icons";
import { Icon } from "@produkto/ui/Icon";

const details: ContactDetail[] = [
  {
    icon: <Icon icon={Mail01Icon} />,
    label: "Email",
    value: "hello@example.com",
    link: "mailto:hello@example.com",
  },
  {
    icon: <Icon icon={SmartPhone01Icon} />,
    label: "Phone",
    value: "+00 000 000 000",
    link: "tel:+00000000000",
  },
  {
    icon: <Icon icon={Location01Icon} />,
    label: "Address",
    value: "Street name 1\n0000 City",
  },
];

const Example = () => (
  <Contact
    description="A short line about how to reach the team goes here."
    details={details}
    eyebrow="Contact"
    title="Your headline goes here"
  />
);

export default Example;

Centred

align="center" centres the heading, lays the details in cards and sets the form under them.

Contact

Your headline goes here

A short line about how to reach the team goes here.

import { Contact, type ContactDetail } from "@produkto/ui/Contact";
import {
  Location01Icon,
  Mail01Icon,
  SmartPhone01Icon,
} from "@hugeicons/core-free-icons";
import { Icon } from "@produkto/ui/Icon";

const details: ContactDetail[] = [
  {
    icon: <Icon icon={Mail01Icon} />,
    label: "Email",
    value: "hello@example.com",
    link: "mailto:hello@example.com",
  },
  {
    icon: <Icon icon={SmartPhone01Icon} />,
    label: "Phone",
    value: "+00 000 000 000",
    link: "tel:+00000000000",
  },
  {
    icon: <Icon icon={Location01Icon} />,
    label: "Address",
    value: "Street name 1\n0000 City",
  },
];

const send = () => new Promise<void>((resolve) => setTimeout(resolve, 600));

const Example = () => (
  <Contact
    align="center"
    description="A short line about how to reach the team goes here."
    details={details}
    eyebrow="Contact"
    onSubmit={send}
    title="Your headline goes here"
  />
);

export default Example;

API Reference

Contact

ContactProps · blocks/Contact/Contact.types.ts
PropTypeDefault
detailsContactDetail[]-
mapReactNode-
mapFirstbooleanfalse
hoursContactHours-
statusReactNode-
locationsContactLocation[]-
onSubmit(values: ContactValues) => void | Promise<void>-
submitLabelstring-
idstring-
eyebrowstring-
titleReactNode-
descriptionReactNode-
alignSectionAlign"start" | "center" | "end""start"
mutedbooleanfalse
classNamestring-

ContactDetail

used by details
PropTypeDefault
labelrequiredstring-
valuerequiredstring-
linkstring-
iconReactNode-
actionBlockLink-

ContactHours

used by hours
PropTypeDefault
titleReactNode-
rowsrequiredContactHour[]-

ContactLocation

used by locations
PropTypeDefault
namerequiredstring-
detailsContactDetail[]-
mapReactNode-

ContactValues

used by onSubmit
PropTypeDefault
namerequiredstring-
emailrequiredstring-
messagerequiredstring-

BlockLink

used by its parts
PropTypeDefault
labelrequiredstring-
linkrequiredstring-

ContactHour

used by hours
PropTypeDefault
daysrequiredstring-
timerequiredstring-
todayboolean-