Navigation

v2.1.0
Marketing blocks

Contact

An inquiry form beside the ways to reach the team, and when to expect an answer.

A contact block is where a visitor writes to the company: a few fields on a sheet, laid out by form, beside the ways to reach the team without it. What it promises is as much a part of it as the fields: who reads the message, and by when they answer.

Contact

<section class="container-inline px-lg py-4xl" data-example="contact" aria-labelledby="contact-title">  <div class="grid gap-2xl items-start max-w(960) mx-auto grid-cols(2)@container(--4xl)">    <div class="flex flex-col gap-xl">      <header class="flex flex-col gap-sm">        <p class="eyebrow">Contact</p>        <h2 class="heading heading-2xl" id="contact-title">Talk to the people who run Atlas.</h2>        <p class="lead">Tell us what you are deploying. Someone on the team reads every message and answers within one business day.</p>      </header>      <dl class="data-list">        <div class="data-list-item">          <dt class="data-list-term">Email</dt>          <dd class="data-list-value">            <a class="link" href="mailto:hello@atlas.dev">hello@atlas.dev</a>          </dd>        </div>        <div class="data-list-item">          <dt class="data-list-term">Hours</dt>          <dd class="data-list-value">Monday to Friday, 09:00 to 18:00 (UTC+8)</dd>        </div>        <div class="data-list-item">          <dt class="data-list-term">Outages</dt>          <dd class="data-list-value">            <a class="link" href="#contact-title">status.atlas.dev</a>, updated within minutes</dd>        </div>      </dl>    </div>    <div class="sheet p-xl">      <div data-contact-ask>        <form class="form">          <div class="form-row">            <div class="field">              <label for="contact-name">Name</label>              <input class="input" id="contact-name" name="name" autocomplete="name" required data-error="contact-name-error">              <span class="field-error" id="contact-name-error">Enter your name.</span>            </div>            <div class="field">              <label for="contact-email">Email</label>              <input class="input" id="contact-email" type="email" name="email" autocomplete="email" placeholder="you@company.com" required data-error="contact-email-error">              <span class="field-error" id="contact-email-error">Enter an email address, such as you@company.com.</span>            </div>          </div>          <div class="field">            <label for="contact-topic">Topic</label>            <select class="select" id="contact-topic" name="topic">              <option class="select-option" value="General question">General question</option>              <option class="select-option" value="Sales">Sales</option>              <option class="select-option" value="Support">Support</option>            </select>          </div>          <div class="field">            <label for="contact-message">Message</label>            <textarea class="input input-auto" id="contact-message" name="message" required aria-describedby="contact-message-hint" data-error="contact-message-error"></textarea>            <span class="field-hint" id="contact-message-hint">What you are deploying, and where it is stuck.</span>            <span class="field-error" id="contact-message-error">Write a message, even a short one.</span>          </div>          <noscript>            <p class="m(0) fg-text-muted">This form needs JavaScript to send. Write to              <a class="link" href="mailto:hello@atlas.dev">hello@atlas.dev</a>instead.</p>          </noscript>          <div class="form-actions">            <button class="btn btn-primary" disabled>Send message</button>          </div>        </form>      </div>      <div data-contact-result hidden>        <div class="flex flex-col gap-lg">          <div class="alert alert-success">            <svg class="icon alert-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">              <circle cx="8" cy="8" r="6" />              <path d="M5 8L7.1041 9.8703A0.2 0.2 0 0 0 7.3832 9.8573L10.75 6.25" />            </svg>            <div class="alert-body">              <h3 class="alert-title" tabindex="-1" data-contact-result-title>Message sent</h3>              <p class="alert-description">Thanks,                <span data-contact-value="name"></span>. We reply to                <span data-contact-value="email"></span>within one business day.</p>            </div>          </div>          <dl class="data-list">            <div class="data-list-item">              <dt class="data-list-term">Topic</dt>              <dd class="data-list-value" data-contact-value="topic"></dd>            </div>            <div class="data-list-item">              <dt class="data-list-term">Message</dt>              <dd class="data-list-value whitespace-pre-line" data-contact-value="message"></dd>            </div>          </dl>          <div class="flex">            <button type="button" class="btn" data-contact-edit>Edit message</button>          </div>        </div>      </div>    </div>  </div></section>
Leave a field empty and press Send message to see the errors, then fill the form in. Nothing is sent: the result is drawn from what you typed.

Blocks are markup to copy. They take the page's own text color and size; the previews set fg-text-body text-sm on the body. Each block is a size container, so it reflows by its own width.

#What is in it

  • Two columns from 56rem of block. grid-cols(2)@container(--4xl) sets the words beside the form, and items-start keeps each column as tall as what it holds. Below that the words come first, since they say what the form is for.
  • A promise in the lead. "Within one business day" is the sentence a visitor is looking for. Write the one your team keeps.
  • The other ways in are a data list: an address, the hours and where outages are reported. A visitor who would rather write an email than fill a form has not left.
  • Four fields. A name, an email, a topic and the message. The name and the email are one form-row, so they share a line from 28rem of form and stack below it. The topic is a select with a first option that fits most messages, so it never has to be chosen.
  • Each field is a field that holds a <label for> and its control, with the hint and the error after them. The hint is tied to the field with aria-describedby; a field-error shows only while its field is invalid.
  • One button, at the end, in form-actions. It is disabled in the markup and the script turns it on, so a form with no server behind it cannot be sent to the page it stands on.
  • The result takes the form's place: an alert that says what happens next, what was written as a second data list, and a button that goes back to change it.

#What needs a script

The rules are the browser's: required on three fields and type="email" on one. The stylesheet draws a field as invalid from :user-invalid, which matches only after the reader has edited the field or tried to submit, so nothing is red when the page loads and an error leaves as soon as the value is valid.

main.js does four things. It turns the button on. It adds a field's error to aria-describedby while the error shows and takes it out afterwards, so the message is read with the field and not before. On a valid submit it writes the values into the result as text, shows it and moves focus to its title. "Edit message" brings the form back as it was left, with focus in the message.

It sends nothing. In an application the submit handler posts the form and shows the result when the server answers, or an alert alert-danger with role="alert" when it does not. Without the script the fields, labels and hints are all there, the button stays disabled, and a <noscript> line gives the address to write to.

#Channels

When a form is more than the page needs, list the addresses. Each row of the data list is a team: its address, what to write to it about and how soon it answers. A neutral alert under the list points an outage at the status page, which is faster than any inbox.

Channels

<section class="container-inline px-lg py-4xl" aria-labelledby="contact-channels-title">  <div class="flex flex-col gap-xl max-w(720) mx-auto">    <header class="flex flex-col gap-sm">      <p class="eyebrow">Contact</p>      <h2 class="heading heading-2xl" id="contact-channels-title">        Write to the team that can help.      </h2>      <p class="lead max-w(560)">        Every address is read by the people who do that work, Monday to Friday, 09:00 to 18:00 (UTC+8).      </p>    </header>    <div class="sheet px-lg py-xs">      <dl class="data-list">        <div class="data-list-item">          <dt class="data-list-term">Sales</dt>          <dd class="data-list-value">            <a class="link" href="mailto:sales@atlas.dev">sales@atlas.dev</a><span class="block font-regular fg-text-muted">              Plans, seats and invoices. Answered within one business day.            </span>          </dd>        </div>        <div class="data-list-item">          <dt class="data-list-term">Support</dt>          <dd class="data-list-value">            <a class="link" href="mailto:support@atlas.dev">support@atlas.dev</a><span class="block font-regular fg-text-muted">              A build, a domain or a deployment that misbehaves. Pro workspaces hear back by the next day.            </span>          </dd>        </div>        <div class="data-list-item">          <dt class="data-list-term">Security</dt>          <dd class="data-list-value">            <a class="link" href="mailto:security@atlas.dev">security@atlas.dev</a><span class="block font-regular fg-text-muted">              Report a vulnerability. Acknowledged within 24 hours, every day of the week.            </span>          </dd>        </div>        <div class="data-list-item">          <dt class="data-list-term">Press</dt>          <dd class="data-list-value">            <a class="link" href="mailto:press@atlas.dev">press@atlas.dev</a><span class="block font-regular fg-text-muted">              Interviews, logos and facts about the company.            </span>          </dd>        </div>      </dl>    </div>    <div class="alert">      <svg class="icon alert-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">        <circle cx="8" cy="8" r="6" /><circle cx="8" cy="5" r="0.5" fill="currentColor" stroke="none" /><path d="M8 8L8 11" />      </svg>      <div class="alert-body">        <p class="alert-title">Is something down?</p>        <p class="alert-description">          Incidents are posted on the status page within minutes, before anyone reads an inbox.        </p>      </div>      <a class="btn btn-sm" href="#contact-channels-title">Open status</a>    </div>  </div></section>
import InfoCircleIcon from '@master/icons-react/native/16/soft/info-circle'<section className="container-inline px-lg py-4xl" aria-labelledby="contact-channels-title">  <div className="flex flex-col gap-xl max-w(720) mx-auto">    <header className="flex flex-col gap-sm">      <p className="eyebrow">Contact</p>      <h2 className="heading heading-2xl" id="contact-channels-title">        Write to the team that can help.      </h2>      <p className="lead max-w(560)">        Every address is read by the people who do that work, Monday to Friday, 09:00 to 18:00 (UTC+8).      </p>    </header>    <div className="sheet px-lg py-xs">      <dl className="data-list">        <div className="data-list-item">          <dt className="data-list-term">Sales</dt>          <dd className="data-list-value">            <a className="link" href="mailto:sales@atlas.dev">sales@atlas.dev</a><span className="block font-regular fg-text-muted">              Plans, seats and invoices. Answered within one business day.            </span>          </dd>        </div>        <div className="data-list-item">          <dt className="data-list-term">Support</dt>          <dd className="data-list-value">            <a className="link" href="mailto:support@atlas.dev">support@atlas.dev</a><span className="block font-regular fg-text-muted">              A build, a domain or a deployment that misbehaves. Pro workspaces hear back by the next day.            </span>          </dd>        </div>        <div className="data-list-item">          <dt className="data-list-term">Security</dt>          <dd className="data-list-value">            <a className="link" href="mailto:security@atlas.dev">security@atlas.dev</a><span className="block font-regular fg-text-muted">              Report a vulnerability. Acknowledged within 24 hours, every day of the week.            </span>          </dd>        </div>        <div className="data-list-item">          <dt className="data-list-term">Press</dt>          <dd className="data-list-value">            <a className="link" href="mailto:press@atlas.dev">press@atlas.dev</a><span className="block font-regular fg-text-muted">              Interviews, logos and facts about the company.            </span>          </dd>        </div>      </dl>    </div>    <div className="alert">      <InfoCircleIcon className="icon alert-icon" />      <div className="alert-body">        <p className="alert-title">Is something down?</p>        <p className="alert-description">          Incidents are posted on the status page within minutes, before anyone reads an inbox.        </p>      </div>      <a className="btn btn-sm" href="#contact-channels-title">Open status</a>    </div>  </div></section>
<script>  import InfoCircleIcon from '@master/icons-svelte/native/16/soft/info-circle'</script><section class="container-inline px-lg py-4xl" aria-labelledby="contact-channels-title">  <div class="flex flex-col gap-xl max-w(720) mx-auto">    <header class="flex flex-col gap-sm">      <p class="eyebrow">Contact</p>      <h2 class="heading heading-2xl" id="contact-channels-title">        Write to the team that can help.      </h2>      <p class="lead max-w(560)">        Every address is read by the people who do that work, Monday to Friday, 09:00 to 18:00 (UTC+8).      </p>    </header>    <div class="sheet px-lg py-xs">      <dl class="data-list">        <div class="data-list-item">          <dt class="data-list-term">Sales</dt>          <dd class="data-list-value">            <a class="link" href="mailto:sales@atlas.dev">sales@atlas.dev</a><span class="block font-regular fg-text-muted">              Plans, seats and invoices. Answered within one business day.            </span>          </dd>        </div>        <div class="data-list-item">          <dt class="data-list-term">Support</dt>          <dd class="data-list-value">            <a class="link" href="mailto:support@atlas.dev">support@atlas.dev</a><span class="block font-regular fg-text-muted">              A build, a domain or a deployment that misbehaves. Pro workspaces hear back by the next day.            </span>          </dd>        </div>        <div class="data-list-item">          <dt class="data-list-term">Security</dt>          <dd class="data-list-value">            <a class="link" href="mailto:security@atlas.dev">security@atlas.dev</a><span class="block font-regular fg-text-muted">              Report a vulnerability. Acknowledged within 24 hours, every day of the week.            </span>          </dd>        </div>        <div class="data-list-item">          <dt class="data-list-term">Press</dt>          <dd class="data-list-value">            <a class="link" href="mailto:press@atlas.dev">press@atlas.dev</a><span class="block font-regular fg-text-muted">              Interviews, logos and facts about the company.            </span>          </dd>        </div>      </dl>    </div>    <div class="alert">      <InfoCircleIcon class="icon alert-icon" />      <div class="alert-body">        <p class="alert-title">Is something down?</p>        <p class="alert-description">          Incidents are posted on the status page within minutes, before anyone reads an inbox.        </p>      </div>      <a class="btn btn-sm" href="#contact-channels-title">Open status</a>    </div>  </div></section>
<script setup>import InfoCircleIcon from '@master/icons-vue/native/16/soft/info-circle'</script><template>  <section class="container-inline px-lg py-4xl" aria-labelledby="contact-channels-title">    <div class="flex flex-col gap-xl max-w(720) mx-auto">      <header class="flex flex-col gap-sm">        <p class="eyebrow">Contact</p>        <h2 class="heading heading-2xl" id="contact-channels-title">          Write to the team that can help.        </h2>        <p class="lead max-w(560)">          Every address is read by the people who do that work, Monday to Friday, 09:00 to 18:00 (UTC+8).        </p>      </header>      <div class="sheet px-lg py-xs">        <dl class="data-list">          <div class="data-list-item">            <dt class="data-list-term">Sales</dt>            <dd class="data-list-value">              <a class="link" href="mailto:sales@atlas.dev">sales@atlas.dev</a><span class="block font-regular fg-text-muted">                Plans, seats and invoices. Answered within one business day.              </span>            </dd>          </div>          <div class="data-list-item">            <dt class="data-list-term">Support</dt>            <dd class="data-list-value">              <a class="link" href="mailto:support@atlas.dev">support@atlas.dev</a><span class="block font-regular fg-text-muted">                A build, a domain or a deployment that misbehaves. Pro workspaces hear back by the next day.              </span>            </dd>          </div>          <div class="data-list-item">            <dt class="data-list-term">Security</dt>            <dd class="data-list-value">              <a class="link" href="mailto:security@atlas.dev">security@atlas.dev</a><span class="block font-regular fg-text-muted">                Report a vulnerability. Acknowledged within 24 hours, every day of the week.              </span>            </dd>          </div>          <div class="data-list-item">            <dt class="data-list-term">Press</dt>            <dd class="data-list-value">              <a class="link" href="mailto:press@atlas.dev">press@atlas.dev</a><span class="block font-regular fg-text-muted">                Interviews, logos and facts about the company.              </span>            </dd>          </div>        </dl>      </div>      <div class="alert">        <InfoCircleIcon class="icon alert-icon" />        <div class="alert-body">          <p class="alert-title">Is something down?</p>          <p class="alert-description">            Incidents are posted on the status page within minutes, before anyone reads an inbox.          </p>        </div>        <a class="btn btn-sm" href="#contact-channels-title">Open status</a>      </div>    </div>  </section></template>

The list keeps the measure of one column of reading, max-w(720). Under 20rem of list each team's name moves above its address, which is the data list's own doing.

#Accessibility

  • The block is a <section> named by its <h2>. The result's title is an <h3> with tabindex="-1": focus moves to it when the result appears, so a screen reader starts at the answer and the keyboard continues from there.
  • Every field has a visible label and an autocomplete value: name and email are what let the browser fill them in.
  • An error is words beside its field, in the field's aria-describedby while it shows. Each one says what to do: "Enter an email address, such as [email protected]."
  • A failed submit keeps the browser's own behavior: focus goes to the first field that is wrong.
  • The button is disabled only until the script is ready, never while the form is merely incomplete. A disabled button cannot say what is missing; a submitted form can.
  • An address is a mailto: link whose text is the address, so it can be read, copied and followed.