Skip to main content

ByLast reviewed

BiModal Design Examples

Production-ready code examples that work for humans and AI agents

These examples demonstrate BiModal Design principles in practice. Each example includes semantic HTML, ARIA attributes, structured data, and progressive enhancement. You can copy and adapt any of these patterns for your own projects.

1

Product Card

E-commerce product listing with pricing and cart action

BiModal Features:

  • ✓ Schema.org Product structured data
  • ✓ Agent-friendly data attributes
  • ✓ Accessible button with clear action
  • ✓ Descriptive image alt text
  • ✓ Works without JavaScript
<article
  data-agent-component="product-card"
  data-agent-content-type="product"
  itemScope
  itemType="https://schema.org/Product"
>
  <img
    src="/mouse.jpg"
    alt="Ergonomic wireless mouse with 5 programmable buttons"
    itemProp="image"
    width="300"
    height="300"
  >

  <h3 itemProp="name" data-agent-content="product-name">
    Ergonomic Wireless Mouse
  </h3>

  <p itemProp="description" data-agent-content="product-description">
    Comfortable wireless mouse with programmable buttons and long battery life
  </p>

  <div>
    <p itemProp="offers" itemScope itemType="https://schema.org/Offer">
      <span
        itemProp="price"
        data-agent-content="product-price"
      >
        $49.99
      </span>
      <meta itemProp="priceCurrency" content="USD">
      <link itemProp="availability" href="https://schema.org/InStock">
      <span>In Stock</span>
    </p>
  </div>

  <form
    action="/cart/add"
    method="POST"
    data-agent-action="add-to-cart"
    data-agent-intent="purchase"
  >
    <input type="hidden" name="product-id" value="wireless-mouse-001">
    <button
      type="submit"
      aria-label="Add Ergonomic Wireless Mouse to cart"
    >
      Add to Cart
    </button>
  </form>
</article>
2

Contact Form

Accessible form with validation and error handling

BiModal Features:

  • ✓ All inputs properly labeled
  • ✓ Required fields marked with aria-required
  • ✓ Error messages with role="alert"
  • ✓ Hint text with aria-describedby
  • ✓ Server-side validation (works without JS)
  • ✓ Clear form purpose with data-agent-action
<form
  action="/contact"
  method="POST"
  data-agent-action="get-support"
  data-agent-intent="contact"
  aria-label="Contact form"
>
  <!-- Name field -->
  <div>
    <label for="name">
      Name <span aria-label="required">*</span>
    </label>
    <input
      type="text"
      id="name"
      name="name"
      required
      aria-required="true"
    >
  </div>

  <!-- Email field with hint -->
  <div>
    <label for="email">
      Email <span aria-label="required">*</span>
    </label>
    <input
      type="email"
      id="email"
      name="email"
      required
      aria-required="true"
      aria-describedby="email-hint"
    >
    <p id="email-hint" class="hint">
      We'll never share your email with anyone
    </p>
  </div>

  <!-- Phone field with error (if validation failed) -->
  <div>
    <label for="phone">Phone</label>
    <input
      type="tel"
      id="phone"
      name="phone"
      aria-describedby="phone-error"
      aria-invalid="true"
    >
    <p id="phone-error" role="alert" class="error">
      Please enter a valid phone number (e.g., 555-123-4567)
    </p>
  </div>

  <!-- Message field -->
  <div>
    <label for="message">
      Message <span aria-label="required">*</span>
    </label>
    <textarea
      id="message"
      name="message"
      rows="5"
      required
      aria-required="true"
    ></textarea>
  </div>

  <!-- Consent checkbox -->
  <div>
    <label>
      <input
        type="checkbox"
        name="consent"
        required
        aria-required="true"
      >
      I agree to the privacy policy
    </label>
  </div>

  <!-- Submit button -->
  <button type="submit">
    Send Message
  </button>
</form>
5

Blog Article

Article with Schema.org markup and proper structure

BiModal Features:

  • ✓ Schema.org BlogPosting structured data
  • ✓ Proper heading hierarchy
  • ✓ Author and date metadata
  • ✓ Table of contents with skip links
  • ✓ Semantic article structure
<!-- Structured data in head -->
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": "Getting Started with BiModal Design",
  "description": "Learn how to build websites for humans and AI agents",
  "image": "https://example.com/article-image.jpg",
  "author": {
    "@type": "Person",
    "name": "Jane Developer",
    "url": "https://example.com/author/jane"
  },
  "publisher": {
    "@type": "Organization",
    "name": "BiModal Design",
    "logo": {
      "@type": "ImageObject",
      "url": "https://example.com/logo.png"
    }
  },
  "datePublished": "2025-01-15T08:00:00Z",
  "dateModified": "2025-01-20T10:30:00Z",
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": "https://example.com/blog/bimodal-intro"
  }
}
</script>

<!-- Article structure -->
<article data-agent-component="main-content" data-agent-content-type="article">
  <!-- Header -->
  <header>
    <h1 data-agent-content="page-title">Getting Started with BiModal Design</h1>

    <p class="meta">
      By <span>Jane Developer</span> •
      <time datetime="2025-01-15T08:00:00Z">
        January 15, 2025
      </time>
    </p>
  </header>

  <!-- Table of contents -->
  <nav aria-label="Table of contents">
    <h2>Contents</h2>
    <ul>
      <li><a href="#introduction">Introduction</a></li>
      <li><a href="#principles">Core Principles</a></li>
      <li><a href="#implementation">Implementation</a></li>
      <li><a href="#conclusion">Conclusion</a></li>
    </ul>
  </nav>

  <!-- Article body -->
  <div data-agent-field="content">
    <section id="introduction" aria-labelledby="intro-heading">
      <h2 id="intro-heading">Introduction</h2>
      <p>
        BiModal Design is an approach to web development that creates
        interfaces accessible to both human users and AI agents...
      </p>
    </section>

    <section id="principles" aria-labelledby="principles-heading">
      <h2 id="principles-heading">Core Principles</h2>
      <p>
        The foundation of BiModal Design rests on three principles...
      </p>
    </section>

    <section id="implementation" aria-labelledby="implementation-heading">
      <h2 id="implementation-heading">Implementation</h2>
      <p>
        To implement BiModal Design, start with semantic HTML...
      </p>
    </section>

    <section id="conclusion" aria-labelledby="conclusion-heading">
      <h2 id="conclusion-heading">Conclusion</h2>
      <p>
        By following these principles, you can build websites that
        serve both audiences effectively...
      </p>
    </section>
  </div>
</article>
7

Data Table

Accessible data table with sortable columns

BiModal Features:

  • ✓ Proper table structure (thead, tbody)
  • ✓ Column headers with scope="col"
  • ✓ Caption for table description
  • ✓ aria-sort for sortable columns
  • ✓ Data attributes for values
<table>
  <caption>Product Inventory</caption>

  <thead>
    <tr>
      <th scope="col">
        <button aria-sort="ascending">Product</button>
      </th>
      <th scope="col">
        <button aria-sort="none">Price</button>
      </th>
      <th scope="col">
        <button aria-sort="none">In Stock</button>
      </th>
      <th scope="col">Actions</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>Wireless Mouse</td>
      <td>$49.99</td>
      <td>25</td>
      <td>
        <button aria-label="Edit Wireless Mouse">Edit</button>
      </td>
    </tr>

    <tr>
      <td>Keyboard</td>
      <td>$89.99</td>
      <td>12</td>
      <td>
        <button aria-label="Edit Keyboard">Edit</button>
      </td>
    </tr>

    <tr>
      <td>Monitor</td>
      <td>$299.99</td>
      <td>8</td>
      <td>
        <button aria-label="Edit Monitor">Edit</button>
      </td>
    </tr>
  </tbody>
</table>
8

Login Form

Authentication form with security best practices

BiModal Features:

  • ✓ autocomplete attributes for password managers
  • ✓ aria-describedby for password requirements
  • ✓ Clear error messages
  • ✓ data-agent-action and data-agent-intent attributes
  • ✓ data-requires-auth for protected routes
<form
  action="/login"
  method="POST"
  data-agent-action="skip-to-content"
  data-agent-page="login"
  data-agent-intent="authenticate"
>
  <h2>Sign In</h2>

  <!-- Email field -->
  <div>
    <label for="email">Email</label>
    <input
      type="email"
      id="email"
      name="email"
      autocomplete="email"
      required
      aria-required="true"
    >
  </div>

  <!-- Password field -->
  <div>
    <label for="password">Password</label>
    <input
      type="password"
      id="password"
      name="password"
      autocomplete="current-password"
      required
      aria-required="true"
      aria-describedby="password-requirements"
    >
    <p id="password-requirements" class="hint">
      Password must be at least 8 characters
    </p>
  </div>

  <!-- Remember me -->
  <div>
    <label>
      <input type="checkbox" name="remember">
      Remember me
    </label>
  </div>

  <!-- Error message (shown if login fails) -->
  <div role="alert" aria-live="polite" class="error">
    Invalid email or password. Please try again.
  </div>

  <!-- Submit button -->
  <button type="submit">
    Sign In
  </button>

  <!-- Alternative actions -->
  <p>
    <a href="/forgot-password">Forgot password?</a>
  </p>

  <p>
    Don't have an account?
    <a href="/signup">Sign up</a>
  </p>
</form>
9

Defensive Form Constraints

Proactively block destructive or invalid actions by autonomous agents

BiModal Features:

  • ✓ HTML5 validation attributes proactively constrain agents
  • ✓ Explicit patterns guide agent tool use
<form id="transfer-funds-form">
  <!-- The pattern and min/max explicitly constrain agent behavior before submission -->
  <input
    type="text"
    name="account"
    required
    pattern="[0-9]{10}"
    aria-label="10-digit Account Number"
  />
  <input
    type="number"
    name="amount"
    required
    min="1"
    max="5000"
    aria-label="Transfer Amount (Max 5000)"
  />
  <button type="submit" aria-label="Confirm Transfer">Transfer</button>
</form>
10

Human-in-the-Loop Confirmation

Semantic HITL confirmation pattern for autonomous agents (τ-bench)

BiModal Features:

  • ✓ Semantic Blocking with <dialog aria-modal="true">
  • ✓ Action Context with schema.org/ConfirmAction
  • ✓ Deterministic Completion via form method="dialog"
<!-- The dialog blocks the rest of the UI, explicitly pausing the agent -->
<dialog
  id="confirmation-modal"
  aria-modal="true"
  aria-labelledby="confirm-title"
  itemscope
  itemtype="https://schema.org/ConfirmAction"
>
  <h2 id="confirm-title" itemprop="name">Confirm Transfer</h2>
  <p itemprop="description">
    Are you sure you want to transfer $5,000 to Account 1234567890?
  </p>

  <form method="dialog">
    <!-- The human or agent must interact with these explicit controls -->
    <button value="cancel" aria-label="Cancel transfer">Cancel</button>
    <button value="confirm" aria-label="Confirm transfer">Confirm</button>
  </form>
</dialog>

<script>
  // Show the modal explicitly to trigger a focus change and pause flow
  document.getElementById('confirmation-modal').showModal();
</script>

Build Your Own BiModal Site

Now that you've seen these examples, follow our step-by-step tutorial to build your first BiModal site from scratch.

Start the Tutorial →