Coding guide: Confirmations

Download resources

Here you can find examples of how to create confirmations on Firefox OS, as well as downloads for the CSS and image resources used by the built-in apps on Firefox OS. You can copy these resources into your app and make use of them to build apps that match these apps' appearances.

Implementing confirmations

To implement a confirmation panel using the styles shown here, place the CSS and media files into your app and then import the CSS using the @import at-rule:

@import url(resources/confirm.css);

Make sure the media files are in the location expected by the CSS (either by placing them in a corresponding location or by revising the CSS).

Examples

Note: Some desktop browsers will show a scroll bar in these examples; that doesn't happen on mobile devices.

Simple confirmation box

This code implements a simple confirmation box with a title and a body message.

HTML

<form role="dialog" data-type="confirm">
  <section>
    <h1>Confirmation</h1>
    <p>Are you sure you want to delete this contact?</p>
  </section>
  <menu>
    <button>Cancel</button>
    <button class="danger">Delete</button>
  </menu>
</form>


Firefox OS live demos generally require a Gecko-based browser, and work best in recent builds of Firefox.

Confirmation without a title

HTML

<form role="dialog" data-type="confirm">
  <section>
    <p>Are you sure you want to delete this contact?</p>
  </section>
  <menu>
    <button>Cancel</button>
    <button class="danger">Delete</button>
  </menu>
</form>


Firefox OS live demos generally require a Gecko-based browser, and work best in recent builds of Firefox.

Confirmation with body content

HTML

<form role="dialog" data-type="confirm">
  <section>
    <h1>Confirmation</h1>
    <p>
      <img alt="Lightbox Icon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADcAAAA3CAYAAACo29JGAAAYtUlEQVR4XqWaeaymV33fP2d51ne5+517587imbHHY7vUgI0xNk4gtAltYkjaFKlp07QiiUJE01at+kf/jNSq/3UxpaiFohI1ISpEFMuxk7IkAswSNoMxjtfZ17u9y/M+y9k6HA0ejTJzVeSvdHSe933Oc8/z/f2+v+XoveK3DzwQ7ustsxdaGSi6MU1ecrJ3J2r/Q6S+h1aBmWqxFBACEYAIRMg4wzPpHxNCgBDiLHycX1s7FhmJbEm8IaQ9NhdXcMeO0QpP33qmeh4gPuO9RwiBlDJ+ttZSnnqGH/zXfy+urSEC0Mfm93HPSLMXhHRok7Hr+4hsHalPoPQ6XipG0pI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Dx48/pZ/unDgxPG5fUexIiPvJaQWdnZmkejJV65w4fyM8ViAz0l0D98khKQjKVqKecnS8oDDB5Y4fHiJtRXoNNQTUMEyuvwKuxdffOHl555+7H997N99iJ8QIYS9yO2Nn//FX/+Zwyfe+uvLh+75+wduvxeZlCQ5WAs+gNSQJNB1sLtjGO3WZElOb6gp5yUqBe8ABwmgFTgDpjKcfPHbTC+9/Aen/vKbH/3MH/6HLwC8HnKSnxBPfOajX3jma0+9/6Vn/vz93/7SE3967sVnuHhpSttBkkZitN5jVc1gxXH4RI+NEy3lisUKsB7SAvLS07aWi+c6Xnzm2zz3rc/96fkXv/7+r37xf78/Env9QPA68HPv+e3B/NLGz6/d/ZZ358Xiu3q99QN5PiQf5BQDTZaDVNC1oDT4ANUUqpGlGY1op2fPds2lz1969bmnLpx98YnPPf7hCXvgdcjy9eFdv/y7tx3aeOCB4fzhe2U6uEuk+qiUxToyWYiNgkt2nFUXvJ294s3lH053X3rm0pkffOPJT//zk+yB10Pu/wGWLthadIR5rwAAAABJRU5ErkJggg%3D%3D">
      <strong>Lightbox</strong>
      <small>Lightbox Enterprises LLC.</small>
    </p>
    <p>Do you want to download and install this application?</p>
  </section>
  <menu>
    <button>Cancel</button>
    <button class="recommend">Install</button>
  </menu>
</form>


Firefox OS live demos generally require a Gecko-based browser, and work best in recent builds of Firefox.

Document Tags and Contributors

 Contributors to this page: chrisdavidmills, openjck, Sheppy, evilpie
 Last updated by: chrisdavidmills,