Skip to content

Molkit Viewer

The Molkit Viewer turns a Molkit SVG export into an interactive teaching panel on your page. It has property overlays, an atom inspector, view tabs for visual sets, a resonance stepper, R-group pickers, and a 3D model with an optional electrostatic potential map.

The viewer is one self-contained script, molkit-widget.js, which defines window.MolkitWidget. It loads two more files from the same folder when a reader needs them: molkit-widget-esp.js (potential maps) and molkit-widget-orbitals.js (orbitals). Host all three together.

The viewer reads the attributes described in Chemistry metadata. Every SVG from the Export SVG dialog carries them, including the 3D conformer that the 3D tab needs and the mk:dipole records that the dipole arrow uses. If a file has no mk:dipole, the viewer sums the drawn bond dipoles itself. Files exported before Molkit 0.24.0 lack some data, such as data-mk-lp-delocalized (and, before 0.23.0, mk:dipole-measured); the viewer works with them but shows less.

Load the script once. It assigns window.MolkitWidget and then dispatches a molkit-widget-ready event on window. A page that loads the script asynchronously can check for the object or wait for the event.

widget-host.html
<div id="mol-panel" style="width: 480px; height: 360px"></div>
<button id="close">Close</button>
<script src="/js/molkit-widget.js" defer></script>
<script>
function start() {
const inst = MolkitWidget.mount(document.getElementById('mol-panel'), {
src: '/img/ethanol.svg',
});
document.getElementById('close').addEventListener('click', () => MolkitWidget.destroy(inst));
}
if (window.MolkitWidget) start();
else window.addEventListener('molkit-widget-ready', start, { once: true });
</script>
Call What it does
MolkitWidget.mount(hostEl, opts) Renders into hostEl and returns an instance handle synchronously. With opts.src the SVG is fetched first, so the viewer appears after the fetch resolves
MolkitWidget.update(inst, opts) Replaces the structure in the same host, for example when the reader picks another molecule. Theme and sizing options carry over
MolkitWidget.setTheme(inst, theme) 'light' or 'dark'. Sets mk-light or mk-dark on the structure SVG and themes the frame of this viewer only, through a data-mkw-theme attribute on its host element. Other viewers on the page and the page’s own classes do not change. 'auto' returns the viewer to the OS setting. Without a call, both follow the OS setting. To switch every viewer at once, call MolkitKit.setTheme(theme); it sets data-mkw-theme on <html> and the class dark on <body>
MolkitWidget.destroy(inst) Disconnects observers, frees the 3D viewer, and empties the host
MolkitWidget.version '0.2.0'

mount options:

Option Meaning
src URL of an exported SVG
svgNode An SVG element you already have, used instead of src
initial 'auto' (default). '3d' or 'both' opens in the 3D view
theme 'light' or 'dark', the same as calling setTheme after mounting. It applies to this viewer only, so two viewers with different themes can sit on one page
large true enlarges the viewer and its hover cards for projection
footer true adds the Made with Molkit credit at the right end of the footer bar
fillWindow false hides the Fill window button, for hosts that are already full-page
espAuto true opens the figure with its electrostatic potential map on. The viewer switches to the 3D tab and turns the map on once the 3D view is ready, at the camera angle stored in the export. The stored angle is used for the first showing only; after that, the reader’s own angle is kept. Use it for a page that shows a figure’s map in place of its drawing. A file without a map, a figure without a 3D view, or a browser without WebGL stays on its opening view, and onEsp is called once with 'failed'
onEsp A function called with 'on', 'off', or 'failed' as the potential map changes, so a page can wait for the map instead of checking the markup
orbitals Opens the figure in 3D with its hybrid orbitals on. true or 'textbook' for the textbook orbitals, 'computed' for the computed bonds and lone pairs, 'mo' for the HOMO, or a level such as 'LUMO' or 'HOMO-1'. An object sets more: { source, mo, pi: 'merged', form: 2, show: 'sigma' | 'pair' | 'p' }. Computed orbitals and MOs need the figure’s precomputed orbital file (by default in ../mkit/orbitals/ beside the figure); without it the textbook orbitals show. A choice the figure cannot take is left out
orbitalPalette, orbitalFinish The orbitals’ starting colors and surface finish ('textbook', 'phases', 'cvd', 'grey'; 'semisoft', 'glossy', 'matte', 'soft', 'satin'). A reader’s own pick in the orbitals’ Look menu wins
view The view a multi-view figure opens on, for example 'lewis', 'vsepr', or '3d'. Case and surrounding spaces do not matter. A view the figure does not have is ignored with a console warning, and the figure opens on its own default
overlay The property shown when the figure opens, for example 'polarity' or 'formal-charge'. Case and spaces do not matter ('Formal charge' works). An unknown property is ignored with a console warning
results Opens the computed results the figure carries; see The results option

The host element can be 0 by 0 at mount time. A ResizeObserver sizes the viewer and the 3D viewer when the host gets its size. The viewer does not throw on bad input: a failed fetch or an unparseable file shows the inline message “Could not load structure.”, and a file that fails to render shows “Could not render structure.”

MolkitWidget.mount calls the lower-level MolkitChem.create(container, source, options) in public/molkit-chem.js. That function also accepts chrome: false (overlays only, no control bar), overlay (a property key to show on open), view (a view id to open on), maxWidth, and the callbacks onInspect(info) and onOverlay(key).

The computed results a figure carries (a reaction path, an IR spectrum, an energy scan) wait behind buttons in the footer bar under the figure, after the view’s name (Computed: on wider screens), and the results option opens them:

{ open: ['path', 'ir', 'scan'], layout: 'stack' or 'tabs', path: { panels, frame, units, tour }, ir: { panels, band, mode, tour }, nmr: { view, signal, hide }, scan: { panels, point, units }, compare: { units } }

Key What it takes
open The results to open, for example ['path', 'ir', 'scan']. A figure with several paths has the keys 'path', 'path2', and so on, and 'compare'; with several scans of one coordinate, 'scan', 'scan2', and 'compare-scans'
layout 'stack' or 'tabs'. layout: 'tabs' keeps one result open at a time
path panels, frame, units, tour
ir panels, band, mode, tour
nmr view is 'h' or 'c', signal a signal’s letter, and hide: true opens with the answers hidden
scan panels; point is 'min', 'max', or a point number from 1; units is 'kcal' or 'kj'
compare units

The fields shared by several keys:

Field Values
panels { structure, plot, table } (each true or false)
frame 'start', 'ts', 'end', or an image number from 1
units 'kcal', 'kj', or 'ev'
band A wavenumber in cm-1
mode 'absorbance' (transmittance is the default)
tour 'start' opens the figure’s guided tour at its first step

An opened result shows below the figure, except a diatomic’s MO diagram ('mo'):

  • It takes the figure’s place while it is open. Its button, a view tab, or a property chip brings the structure back.
  • A note under it gives the bond order and the magnetism. For an ion, the note also says how many electrons more or fewer it has than the two neutral atoms drawn at the sides.

Property overlays. One overlay is shown at a time: formal charge, oxidation state, hybridization, geometry, lone pairs, electronegativity, polarity. The legend text for geometry reads “VSEPR molecular geometry: the shape the bonded atoms make (water is bent).”

Atom card. Pointing at an atom, tapping it, or giving it keyboard focus shows its hybridization, geometry, bond angle, domains, formal charge, oxidation state, and octet, with a one-line explanation under each. Rows with no data are left out; an atom without data-mk-octet (a generic, a bridging hydrogen, a bare metal ion) has no Octet row. Three cases get their own wording:

  • For an atom with data-mk-lp-delocalized, the hybridization line reads ”… domains, but a lone pair is delocalized into the adjacent π bond”.
  • A planar amide nitrogen’s angle line reads “sp2 ideal: the lone pair is delocalized into the adjacent π bond, so it no longer compresses the angle”.
  • For a center whose nonbonding domain is one unpaired electron (NO2), the card says “unpaired electron” and explains that the angle opens.

View tabs. A visual set gets one tab per view (Lewis, VSEPR, Condensed, Bondline, Fischer, Orbitals) plus a 3D tab when the file carries a conformer. A view with two Lewis layouts gets a sub-toggle between them, and a set that mixes octet models gets an Expanded / Octet sub-toggle.

Orbital pictures. A named group that holds orbital pictures gets an Orbitals tab. When it holds several pictures, numbered buttons beside the tab choose one, and the line under the picture says what it shows: the author’s caption, or All orbitals or Pi system, followed by “(2 of 3)” and so on.

Resonance and R-group structures. A file that holds several resonance forms gets a stepper labeled “Form 1/3” and so on. The reader steps through the forms one at a time, or selects “All forms” in the rail to show them together. A generic structure with R-group definitions gets a picker rail at the side. Selecting a substituent swaps in that molecule and returns the viewer to the 2D view.

2D zoom. Three buttons at the top right of the drawing zoom in, zoom out and reset. The other controls:

  • The mouse wheel zooms about the pointer, and a drag pans.
  • On a touch screen, a pinch zooms and a double-tap zooms in or back.
  • Reset view returns to the view the figure opened at and is grayed out while the view is there.

A figure opens framed on the drawing: centered, filling about 80% of the picture in its tighter direction, so a small ion such as ammonium is not lost in white space. Atom letters open no taller than about 44 px, so a small molecule on a large screen stays readable rather than huge. The drawing never opens under the zoom buttons, and switching views keeps that framing.

Choosing another property (oxidation state, hybridization, and so on) keeps the reader’s zoom and position. Only a view the reader has not zoomed or moved widens, and only when the new property’s labels reach past it (geometry, polarity); it never zooms back in.

Footer. The line under the figure names only what is on the stage. A property chosen in 2D and carried into the 3D view is drawn there as values beside the atoms. When the 3D model cannot show it (the polarity overlay with the net dipole arrow turned off), the footer says so. A crystal’s 3D cell shows no values beside its many ions; the footer gives them by element instead (“In the crystal, by element: Na +1, Cl −1.”).

Lone pairs and Net dipole checkboxes.

  • Lone pairs shows or hides every lone pair and appears only when the structure has lone pairs. A charge sign that Molkit placed moves with the checkbox: next to its letter when the pairs are hidden, clear of the dots when they are shown. This works for figures exported with lone pairs shown or hidden. A sign placed by hand stays where it is.
  • Net dipole appears on any view of a molecule that has a net dipole arrow. With no property overlay, or another one, it draws the net arrow alone and starts cleared. Under the polarity overlay it starts selected, and clearing it hides the arrow while the bond dipoles stay drawn. It controls the arrow in 2D and 3D. A molecule whose dipoles cancel, such as benzene, has no checkbox.

A dipole that points straight out of or into the page is drawn as a circle with a dot (toward you) or a cross (away from you), set beside the bonds rather than on one. A molecule whose bond dipoles nearly cancel, such as aniline or triethanolamine, shows no arrow, and the legend says the prediction is nearly zero.

3D shape label. The 3D view says in its top-left corner what made the shape: Predicted shape (MMFF94 force field), or Ideal VSEPR shape (textbook angles, not computed) where Molkit used the textbook shape because the force field has no model for the molecule (sulfur hexafluoride, xenon tetrafluoride). The export marks such a conformer shape="ideal-vsepr".

Formal charges checkbox. Formal charges shows or hides the charge marks that are formal charges only:

  • A neutral molecule’s charges on atoms bonded to an opposite charge (carbon monoxide’s C− and O+, a nitro group’s N+ and O−).
  • An ion’s charges inside the bracket that carries its net charge.

An ion’s only charge mark is never hidden, and neither are a zwitterion’s charges (the NH3+ and COO− of an amino acid).

The checkbox appears only when the figure has such marks. It is off by default, and on by default for a figure with resonance forms. To decide for a page, set data-mk-formal-charges="on" or "off" on the figure or on any element around it. The choice is not stored in the browser.

Two buttons at the top right of the identity bar enlarge the viewer:

  • Fill window covers the browser window with a fixed overlay and works inside iframes.
  • Full screen uses the browser’s Fullscreen API and falls back to the window overlay when the API is blocked.
  • fillWindow: false hides the Fill window button on a page that is already full-page.
  • A result button (such as IR spectrum) clicked in Fill window or full screen returns the viewer to the page first, then opens the result below the figure.
  • With footer: true, a bar at the bottom reads “Made with Molkit” and links to molkit.com.

In the IR panel of a figure with a 3D view, a click on a band of the spectrum or a row of the table plays that vibration in the figure’s own 3D view at once (it opens the 3D tab and scrolls it into view), turned to the angle the model was shown at. Play in 3D does the same for the chosen band.

  • Choosing another band while it plays switches the motion.
  • Stop (on the stage or in the panel), a click on an empty part of the panel, or Escape clears the choice and puts the still model back.
  • The motion is drawn on the browser’s own animation frames, 60 poses a cycle, one cycle a second.
  • A reader whose system asks for reduced motion sees the atoms’ displacements as arrows instead.

A figure without a 3D view keeps the panel’s own Structure picture and its small viewer. When the 3D view cannot start (the browser has no WebGL, or the 3D library did not load), Play in 3D stays unpressed and the panel offers its own Structure picture instead, ringing the atoms that move most.

The viewer stores four choices per browser in localStorage. It still works when storage is blocked.

Key Values Behavior
mkw-view a view id, for example lewis, vsepr Written when the reader picks a 2D view tab. Used on the next structure only if the file has no data-mk-default-view; the author’s default always wins
mkw-lp on, off Lone pairs checkbox. Written only when the reader clicks the checkbox, and applied when the Viewer loads; ctrl.setState({ lp }) from a page script does not store it. With no stored value, lone pairs display as exported
mkw-dipole on, off Net dipole checkbox under the polarity overlay. Default is on
mkw-dipole-view on, off Net dipole checkbox with no polarity overlay (the arrow alone). Default is off

The viewer opens on the first of these that applies: the view option to MolkitChem.create, if that view exists; the file’s data-mk-default-view; the stored mkw-view; the first view.

The arrow is a prediction: the bond-sum record from mk:dipole. The viewer never displays the gasteiger record. Each conformer is aligned to its own drawing, so in a visual set each depiction’s arrow comes from the mk:dipole whose mk:conformer-3d has the same data-mk-view (and data-mk-lewis-layout) as the atoms on screen. In files without view tags, the viewer matches by component index.

The dipole belongs to the molecule, not to one drawing of it. Molkit computes it on one reference conformer per visual set: a geometry adopted from a gas-phase calculation when there is one, otherwise the primary conformer. Every depiction’s mk:dipole has that magnitude, and its dir is the same vector turned into that depiction’s drawing frame. Only the direction on the page changes when a reader switches views.

Each drawn species is classified into one of four states, and the legend shows a verdict and a note:

State When Verdict text
not determinable net formal charge is not zero, or the drawing is separate ions “Dipole not shown”, with the reason. Ions drawn in brackets get no arrow
zero by symmetry prediction is zero and mk:dipole-measured has mu="0" “Nonpolar”, stating μ = 0 by symmetry
prediction zero prediction is zero otherwise “Bond-dipole prediction: 0”. Without a measured value the note says this alone does not prove the molecule is nonpolar; with one, it names the measured moment. When another depiction of the same species has a nonzero bond-sum record, the verdict is “Bond-dipole prediction: 0 for this shape”, and the note says the bond dipoles cancel only in the 3D shape this view was computed on
predicted prediction is nonzero “Bond-dipole prediction → polar”, with “Measured μ = … D (year).” when a reference exists

When mk:dipole-measured carries negative-end (carbon monoxide, nitric oxide), the verdict becomes “Measured dipole: negative end on C” (or N), and the note says the species departs from the rule of thumb and that the arrow shows the measured direction. For a radical, the note adds that the prediction points the right way but overstates the size. The predicted magnitude is never printed, because bond-sum is not in debye.

The calculated moment from the ESP map (mk:esp-dipole) is added as “Calculated (method): μ = … D.” It reads “Calculated for the potential map’s geometry” when it differs from the measured value by a factor of ten or more, or when the view’s zero belongs to its shape. A view whose own conformer has a different shape from the map’s (one bond-dipole sum is zero and the other is not) keeps its own conformer and does not show the map’s calculated moment.

On a Lewis or VSEPR view the arrow sits at the middle of the molecule. On a bondline view, where the middle often falls on a bond, it moves sideways to the nearest place clear of every bond and atom, up to one and a half bond lengths away.

The 3D tab appears when the file has an mk:conformer-3d and the species type allows it. For ionic, the tab is disabled with the reason “3D crystal view coming soon”; for monatomic-ion, the reason is “No 3D model for a single ion”. When the file has several conformers, the viewer uses the one marked data-mk-conformer-primary.

The interactive viewer uses 3Dmol.js, loaded the first time a reader opens the 3D tab, from https://cdn.jsdelivr.net/npm/3dmol@2.5.5/build/3Dmol-min.js. If window.$3Dmol is already defined, the viewer uses it and makes no request. A host that must work offline or avoid third-party scripts can load its own copy of 3Dmol before the 3D tab opens.

If 3Dmol cannot run, the viewer draws a static 3D view that can still be dragged to rotate, with a message naming the cause:

  • “This browser could not start WebGL, so interactive 3D is unavailable …” when the library loaded but WebGL failed.
  • A message that interactive 3D is unavailable offline, when the library could not be fetched.
  • “The 3D view was interrupted; trying again …” when the browser took the view’s WebGL context away (for example, while the tab was in the background) and the first try to start it again failed. The viewer tries again after 1, 2, 4, and 8 seconds, and shows the WebGL message above only if all five tries fail. The hybrid orbital figure does the same, and asks the reader to reload the page if all five tries fail.

The 3D view opens framed on the model: centered, with the drawn atoms filling about 80% of the view in its tighter direction, and below the row of view buttons when that row would cover it (a phone).

The model responds to the mouse and keyboard:

  • Drag to rotate, and roll the mouse wheel up to zoom in or down to zoom out (as in the 2D view).
  • The arrow keys rotate, + and - zoom, and Home resets the view.

A control pad in the corner has the same moves as buttons, in three rows:

  • Roll left, Rotate up, Roll right
  • Rotate left, Reset view, Rotate right
  • Zoom out, Rotate down, Zoom in

The chevron above the pad (Hide controls or Show controls) hides and shows the pad. In a viewer narrower than 520 px the pad starts hidden and the toolbar stays on one row; a reader who shows the pad keeps it shown.

Switching to 2D and back keeps the camera: the model returns at the rotation and zoom the reader left it at.

Two toggle buttons and a Style menu change the drawing:

Toggle Default Effect
Element labels on Element symbols on the atoms
High-contrast colors off A higher-contrast atom palette
Style (menu) Ball and stick Ball and stick, Stick, Spacefill or Wireframe. A crystal cell offers Ball and stick and Spacefill. Each choice fits the model to the view again and keeps its rotation. The menu works from the keyboard: the arrow keys, Home and End move, Escape closes it; it closes when focus leaves it

The 3D model also draws the net dipole arrow. The Dipole button in the 3D view options, beside Labels, Contrast and Style, turns it on and off, and the Net dipole checkbox follows it. The button appears only when the molecule has a net dipole arrow. The caption under the model reads 3D view.

The Orbitals button in a figure’s 3D view replaces the ball-and-stick model with the molecule’s hybrid orbitals, the same picture Molkit’s 3D panel draws. The orbitals code is a separate file, molkit-widget-orbitals.js, which the viewer loads the first time a reader presses the button. Pointing at an orbital shows a card that names it. When the drawn atoms cannot be matched to the 3D model, the viewer shows a note and no orbitals, rather than guessing.

The bar that opens with the orbitals has these controls:

Control What it does
Textbook / Computed Textbook hybrids, or the orbitals computed with xTB. Computed is offered only when the page publishes computed orbitals for the figure.
MOs One molecular orbital at a time, chosen from the menu or from the energy-level ladder at the right of the view (filled levels solid, empty levels dashed).
Forms For a molecule with resonance forms: the merged hybrid or one form at a time.
Octet For a molecule such as SF6: the octet model, with three-center bonds and no d orbitals.
Look Colors, finish, and the outline color and thickness.
Explore Build up (the atomic orbitals mixing into hybrids), Twist (a double bond turned until its π bond breaks), and a short hybridization quiz.

When the figure carries a saved 3D view (see saved 3D views), the 3D tab opens on it:

  • At the author’s angle.
  • In the author’s look: space-filling as Spacefill, stick and wireframe as themselves, any other look as ball and stick. The Style menu changes it.
  • With the layers the author showed. Hydrogens stay hidden if the author hid them, lone-pair lobes and vibration arrows are drawn, and the dipole arrow is drawn flat on top of the model, so the atoms never hide it.
  • With a surface drawn see-through over the model, and an ESP map turned on by itself.

A visual set’s 3D view is the set’s 3D tab, even when the file has no conformer.

If the author gave the view a motion (a spin, a vibration, or a chair flip), a Play button in the 3D view plays it and turns into Pause while it plays. Its label names the motion.

A motion set to start by itself does so when the 3D tab opens, but never for a reader whose system asks for reduced motion; that reader can still press Play, and for a chair flip the button instead shows the other chair as a still (Show end, then Show start). A motion that does not loop plays once, and the button then says Play again.

Coordinate bonds (:c) draw as dashed sticks, and delocalized bonds (:d) draw as a single stick with a dashed companion.

When the figure carries an mk:esp block for the molecule its 3D view shows (see Chemistry metadata), the view tabs get an ESP map tab after 3D, and the 3D view gets an Electrostatic potential map button. The tab is the same 3D view with the map on; the tab and the button always agree (turning the map off with the button selects the 3D tab).

Nothing extra loads until a reader asks for the map. The first time, the viewer fetches molkit-widget-esp.js from the folder that molkit-widget.js was loaded from, then fetches the map data and turns the map on.

A map that is on stays on when the reader switches to 2D and back: it is drawn again before the model appears, and the map data is not fetched a second time.

While the map is on, a strip under the stage shows the color bar, with electron-rich and electron-poor at its ends and the scale in kJ/mol, and a Color scale choice:

Choice What it shows
Compare molecules (the default) The standard scale for the map’s charge: ±200 kJ/mol for every neutral molecule, ±900 for a 1+ or 1− ion, 300 more per further charge. A color means the same potential on every map.
This molecule’s range (This ion’s range for an ion) The scale stretched to this map’s own surface. Small differences show, but colors no longer compare with other maps. For an ion that is negative (or positive) everywhere, the middle color is not zero, and the strip says which potential it stands for.
Author’s scale Only for a figure exported with a fixed range: that range.

A sentence under the bar says which scale is showing. For a nearly nonpolar molecule on Compare molecules (one whose potential stays within a quarter of the scale, such as hexane), it adds a low-contrast hint that points to This molecule’s range. The footer reads “ESP map: red is electron-rich, blue is electron-poor.” The choice is a radio group: the arrow keys move between the options.

A Map options button beside the map button opens a panel with these settings:

  • Colors
  • Range (the same choice as the strip)
  • Opacity (of the surface, or of the cut when only a cut is shown; the cut starts opaque)
  • Show (surface, a cut through the molecule, or both)
  • For a cut, Cut, Position, and Contour lines

The i button shows the map’s caption, any note, and its citations. The panel starts with the display settings stored in the export. The reader’s changes last while the page is open, through switches between 2D and 3D, and are not saved.

A shared link (Copy link) carries a scale the reader chose that differs from the figure’s own (espRange: 'compare', 'own' or 'author' in the link’s state) and the ESP map tab (esp: true).

A shared link has the form #<section>&mkw=<state>. It keeps the page’s section anchor (the viewer scrolls to that section), and its state names the figure (fig: the InChIKey, the InChI, or the SVG’s id). On a page with several viewers, only the named figure applies the link. A link without fig (made before 2026-11-17) applies to the first viewer on the page.

A map in a separate .esp file is looked for in two places, in order:

  1. The path written in the SVG (for example esp/water-1a2b3c4d.esp), resolved against the SVG’s own address.
  2. The file name alone, under a site-wide folder you set with MolkitWidget.espBase or window.MolkitEspBase.

The viewer rejects a file whose checksum differs from the one in the SVG, and the button reports that the map could not be loaded. When neither place has the file, the button says the map file was not found; check that the .esp file was uploaded beside the SVG, in its esp/ folder. The viewer follows only a plain relative path ending in .esp. To serve molkit-widget-esp.js from another location, set window.MolkitEspUrl to its address before the first click.

If the map was calculated on a different geometry (a relaxed one), the model takes that geometry while the map is on and returns to its own when the map is off.

Two figures teach hybridization without a structure file. Both load the orbitals part of the viewer on demand and return a promise of a handle.

Call What it shows
MolkitWidget.mountHybrids(hostEl, opts) One set of hybrid orbitals on a single atom: the atomic orbitals, the mixing, the hybrids, and the shape they point to. opts.set is sp, sp2, sp3, sp3d or sp3d2; opts.pick: true adds buttons for every set
MolkitWidget.mountLesson(hostEl, opts) Orbital boxes beside the 3D build-up of one molecule, on one timeline: ground state, promotion (where needed), hybridization, bonding. opts.lesson is the molecule’s key (below); opts.pick: true adds buttons for every lesson

Both take opts.theme ('light' or 'dark'). The handle has setTheme(theme) and destroy().

Lesson keys:

Key Molecule Key Molecule
ch4 methane c2h4 ethene
nh3 ammonia c2h2 acetylene
h2o water c2h6 ethane
bh3 borane co2 carbon dioxide, oxygen unhybridized
bh2 boron dihydride co2sp carbon dioxide, oxygen as sp
becl2 beryllium chloride co2sp2 carbon dioxide, oxygen as sp2
ph5 phosphorus pentahydride (hypothetical) sh6 sulfur hexahydride (hypothetical)

Next plays to the end of the next step; Previous jumps back without playing. The mouse wheel zooms the 3D view (up zooms in). On the finished molecule, hovering an orbital shows a card that names it. With reduced motion set, a lesson opens on its last step.