s72
  • Toast

    data-toast

    A toast says what just happened and then leaves. It stacks at the bottom right and goes after four seconds. Use a callout instead for a note that should stay.

    Basic

  • html
    <menu>
      <li><button data-toast="Config saved" data-toast-tone="go">Save config</button></li>
      <li><button data-variant="line" data-toast="Build cache cleared" data-toast-tone="stop">Clear the cache</button></li>
      <li><button data-variant="line" data-toast="Copied to clipboard">Copy</button></li>
    </menu>

    data-toast is the text and data-toast-tone is the tone; leave the tone out for the quiet one.

    From script

    html
    <button onclick="S72.toast('182 pages deployed', 'go')">Deploy</button>

    S72.toast(text, tone, ms) takes an optional lifetime in milliseconds, which defaults to 4000.

    Notes