Skip to content

Quick start

  1. Add a loader where the answer will appear.

    No build step needed: paste this into any HTML page.

    <script src="https://cdn.jsdelivr.net/npm/mulling@1/dist/mulling.umd.js"></script>
    <script>Mulling.defineElement();</script>
    <mulling-status state="thinking"></mulling-status>
  2. Change the state as your AI works: thinking, searching, writing, then done or error. The loader cross-fades between them, and screen readers hear each change once.

    const loader = document.querySelector('mulling-status');
    loader.setAttribute('state', 'writing'); // when the first words arrive

    Try it: this is a pretend response going through every state.

    Press “Ask” to start.

  3. Swap in the answer when it’s ready. “Done” is still spoken after the loader is removed; see Endings.

That’s all most apps need. Next: