Set up animation states
A Molkit animation is a sequence of states. Each state is a snapshot of your drawing at one moment, held inside its own frame on the canvas. During playback, Molkit holds each state, then moves every matched object to its place in the next state. Preview and Export become available when the animation has two states.
Example: animate an SN2 reaction
Section titled “Example: animate an SN2 reaction”This example builds one small mechanism: hydroxide attacking bromomethane.
-
Draw hydroxide (an O with a negative charge and its lone pairs) to the left of bromomethane (CH3Br). Add the two curved arrows: one from an oxygen lone pair to the carbon, and one from the C–Br bond to the bromine.
-
Click Animation Mode (the play icon) in the main toolbar, or press Shift+A.
-
Click + New State and drag a rectangle around both molecules and the arrows. That frame is state 1.
-
With state 1 active, click Duplicate. A copy appears in a new frame to the right as state 2, and every copied object is already paired with its original.
-
Edit state 2 into the products: delete the arrows, delete the C–Br bond and draw a bond from O to C, remove the oxygen lone pair that attacked and add a fourth lone pair to bromine, move the bromine away, and move the negative charge from oxygen to bromine.
Alternatively, in step 4, click Next Step instead of Duplicate. It makes the bond, lone pair, and charge changes from the arrows, and you only move the bromine away (see Next Step from arrows).
-
Check the chip between the two thumbnails in the state strip. Green means every object is paired one to one. If it is amber or red, see Object matching.
-
Click Preview. The arrows draw on state 1, the oxygen lone pair stretches into the new C–O bond, and the C–Br bond contracts into the new lone pair on bromide as it moves away.

The lone pair and bond motions in step 7 come from the lone pairs you added and removed in step 5. Reaction choreography explains when Molkit animates them this way, and the order in which the arrows draw.
Enter animation mode
Section titled “Enter animation mode”To enter animation mode, click Animation Mode in the main toolbar or press Shift+A. The animation toolbar appears with the state controls, and the docked Animation panel opens on the right. To leave, press Esc or click Exit.
Outside animation mode, you can also double-click a state frame’s header to enter animation mode with that state active. Animation toolbar describes every control.
Create a state
Section titled “Create a state”- Click + New State. The pointer becomes a crosshair.
- Drag on the canvas to draw the state frame. Atoms inside the rectangle, bonds whose atoms are both inside, and annotations inside become the contents of the new state.
- Drag again to draw more frames; the crosshair stays active. Press Esc to stop.
A state is not a separate copy of your document. The objects stay on the canvas, and each state records which objects belong to it. Anything you later draw or move inside a frame joins that state the next time you enter animation mode.
A Molkit Script can make the states for you: animate [reactants, products] name: sn2 makes one state for each object, in list order, with a frame around each object where it is. The objects must be far enough apart that no frame takes in another object. Each animate makes another animation, and its frames must not overlap the frames of the animations already in the document.
A script can also change an animation it made, or one you named in its properties:
add product into: sn2adds a state around the product, at the end;after: tsputs it after the state that holdsts.remove ts from: sn2removes the state that holdsts. The object stays on the canvas.arrange sn2 as: row,as: column, oras: gridmoves the frames and what they hold into a row, a column, or a grid, in state order.
When a script changes what a state holds, for example by adding an atom or writing a caption inside its frame, the frame grows to hold it. If the larger frame would overlap another frame, Molkit lays out the animation’s frames again in the same arrangement (a column stays a column), and the run’s notes say so. When a script moves what a state holds, the frame moves with it; if it then overlaps something, the notes say so and nothing else moves. Frames the script did not touch keep their size and place. Matches and timing are kept.
Work with state frames
Section titled “Work with state frames”Each state draws as a rounded rectangle with a header that shows its name (“State 1”, plus a custom title if you set one). The active state has a solid blue border; inactive states are gray and dashed. Outside animation mode, the frames stay visible but dimmed.
- To make a state active, click inside its frame.
- To move a frame together with its contents, drag its header.
- To resize the active frame, drag the square handles on its corners and edges.
- To exclude a state from preview and export, click the eye icon in its header. The frame grays out and its transitions show no duration. Click the icon again to include the state. A preview needs at least two included states, so the last two cannot be excluded.
- To clone a state, Shift+drag its header and drop the copy where you want it.
- To select several frames (to delete them together), Shift+click their headers.
Duplicate a state
Section titled “Duplicate a state”To duplicate a state, select it and click Duplicate. Molkit copies every object in it, places the copy in a new frame to the right, inserts the new state directly after the source, and pairs each copy with its original, so the transition moves objects instead of fading them.
States play in their order in the state strip. A new state from + New State goes at the end; Duplicate and Next Step put the copy directly after its source, so to insert a step in the middle, duplicate the state before the gap and edit the copy. To change the order, use Pane order in the animation properties.
Next Step from arrows
Section titled “Next Step from arrows”Next Step works like Duplicate, but it also carries out the curved arrows of the active state on the copy. Each arrow moves one pair of electrons, and the copy gets the result:
- A lone pair to an atom forms a new bond between them; the lone pair is used up.
- A lone pair to a bond the atom is part of raises that bond’s order by one.
- A bond to one of its own atoms breaks one pair of that bond and gives the atom a new lone pair.
- A bond to another atom moves that pair into a new bond from the nearer end of the bond to the atom (a pi bond attacking an H, for example).
- A bond to a neighboring bond shifts a double bond along (one order lower on the first bond, one higher on the second).
Formal charges change to match: the atom that gives electrons away gains a plus, and the atom that receives them gains a minus. The copied curved arrows are removed, everything else in the state is copied as is, and the copy’s objects are paired with the originals as in a duplicate. Atoms stay where they were, so you only rearrange the layout. Ctrl+Z undoes the whole step at once.
For Next Step to read the arrows, draw every lone pair and charge in the state, and attach both ends of each arrow: the tail to a lone pair or a bond, and the head to an atom or a bond. If any arrow cannot be read with certainty, Next Step creates nothing and a message lists the problem. Examples: an end that is not attached, a tail on an atom with no lone pair, a head on a bond that is equally near both of its atoms, or a bond that would lose more electron pairs than it has. Single-electron (fishhook) arrows are not supported.
Also note:
- On an atom whose lone pair count changes, a lone pair you positioned by hand returns to automatic placement, because the old positions no longer fit.
- Straight arrows and pointer arrows (a caption pointing at an atom) are not read, and they stay in the copy.
- Next Step works on structure animations only. In a LaTeX solution animation, it shows a note and changes nothing.
- The new frame is placed the same way as with Duplicate. On a state in the middle of the sequence, the new frame can land on top of the next state’s frame; drag it aside.
- Atoms keep their places, so a new bond can run straight over another atom: in an SN2 step, the bond from the attacking oxygen to carbon crosses whatever hydrogen is drawn on the carbon’s back side. Set the step up first with a state of its own, the molecules turned or moved so nothing sits in the way, or move the atoms in the new state afterward. These set-up states also make a step easier to follow when it plays. Molkit Script’s
next-stepsays in its log when a new bond runs over an atom.
Edit, rename, and delete states
Section titled “Edit, rename, and delete states”To edit a state, make it active and use the normal drawing and selection tools: move atoms, change bond orders, add or remove annotations. Molkit animates the difference between neighboring states.
To rename a state, double-click its title in the state strip, type a title, and press Enter. You can also set Name in the Animation panel while the state is selected.
To delete the active state, click Delete in the animation toolbar, or press Delete (or choose Delete from the Edit menu) with nothing selected on the canvas. Only the frame and its place in the sequence are removed; the drawn objects stay on the canvas.
Several animations in one document
Section titled “Several animations in one document”A document can hold several animations, for example an SN1 and an SN2 mechanism side by side. Each animation has its own states, matches, and timing.
- Switch animations: the first button in the animation toolbar shows the name of the animation you are editing. Click it and choose another animation. The list shows how many states each one has.
- Start another animation: click the same button and choose New animation, then drag on the canvas to draw its first state.
- Duplicate an animation: click the same button and choose Duplicate followed by the animation’s name, or click ⧉ on the animation’s row in the Collections panel. The copy has its own copies of the molecules, with the same states, matches, and timing, and it is placed to the right of the original, clear of other frames and objects. The copy becomes the animation you are editing, or, outside animation mode, the one animation mode opens next. The copy’s name is the next free one: sn2 becomes sn2-2, and Mechanism becomes Mechanism 2. Duplicating is one undo step.
- Keep them apart: the frames of one animation cannot overlap the frames of another, because a frame takes in whatever lies inside it. If you draw a frame over another animation’s frame, Molkit explains and does not create it. A pasted animation is placed clear of the other frames.
- Find them on the canvas: each animation has a teal box around all of its frames, with its name in the top edge after an Ani tag. Click the name to rename the animation in place (Enter saves, Esc cancels), click the ✎ icon to open its properties, or click ▶ to edit it in animation mode. Drag the box’s border to move the whole animation: every frame and everything in it moves together, as one undo step. Outside animation mode this works for every box, and pressing the border also selects the animation’s objects. In animation mode it works for the animation you are editing; a state’s header still drags only that state. Like the frames, the box never appears in exports. Box names and state titles keep a readable size as you zoom, like the names of named selections; state titles fade out when you zoom out below about 70%.
- Find them in the list: every animation is listed in the Collections panel with the Ani tag.
When you enter animation mode, Molkit opens the animation you edited or made last, including one a script just made with animate. In a file you have just opened, it opens the first animation. Preview and export work on the animation you are editing; to export several at once, see Export several animations.
Animation properties
Section titled “Animation properties”The properties dialog sets:
| Field | What it does |
|---|---|
| Name | The name in the toolbar button, the box, and the Collections panel. Two animations cannot share a name, and an animation cannot take the name of an object a script has named. |
| Title | A longer title for the animation. An exported animated SVG carries it as its title, which screen readers announce and browsers show as a tooltip. In a file with several animations, it is the tooltip of that animation’s tab. |
| Description | What the animation shows. An exported animated SVG carries it as its description, which screen readers can read. |
| Export filename | The file name that Export suggests. When it is empty, the name is used, with spaces replaced by underscores. Export fills this field only when you export under a different file name. |
| Speed | How fast the whole animation plays, from 0.05 to 32: 1 is the automatic pace, and 2 is twice as fast. A LaTeX solution animation has no Speed field, because it keeps its own timing. |
| Pane order | The order in which the animation plays its states. Each state is listed by the molecules it holds; the arrow buttons move it earlier or later. When you change the order, Molkit pairs the objects of each new pair of neighboring states again. LaTeX solution animations keep the order of their solution. |
Edit in animation mode closes the dialog and opens the animation in animation mode. Saving the dialog is one undo step.
Where each setting applies
Section titled “Where each setting applies”Some settings belong to a single state, some to the step between two states, and some to the whole animation:
| Scope | Settings |
|---|---|
| One state | Title, frame position and size, the excluded (eye) toggle, custom pivot atoms, time on screen |
| One transition | Duration and motion, automatic unless you override them |
| Whole animation | State order (Pane order in the properties), speed, pivot mode, and the object matches for each pair of states |
Molkit times every step from what happens in it. To change the timing, see Animation timing.