How to print a box with a sliding lid
A sliding lid box that stays shut
A sliding lid box is the simplest way to keep small things safe: the lid runs in two grooves, sits flush with the rim and can’t flip open while the box rattles around in a bag. So that it doesn’t slide out by itself either, it clicks shut on two small bumps. You push it open with your thumb and slide it back with an audible click.
This generator designs sliding lid boxes to your measurements: for SD and microSD cards, screws, pills, batteries, game pieces, jewelry or pencils. You set the inner size, split the box into compartments with dividers, add a card comb and put a name or a symbol on the lid, in a second color if you like.
You’ll find ready-made versions among the examples, such as the screw box with six compartments, the SD card box with a card comb or the gift box with a red heart.
How the generator works
The generator runs entirely in your browser. Nothing is uploaded, and your design lives in the link: use “Share” to send exactly this box to someone or bookmark it. Every change shows up in the 3D preview right away.
- Enter the inner size under “Size”: “Inner width”, “Inner length” and “Inner height”.
- Check the “Play” and the “Snap” under “Lid and fit”.
- Add dividers or a card comb under “Inside”.
- Write a text on the lid or pick a symbol under “Label”.
- Choose the colors and download the file as STL or 3MF.
Box and lid lie side by side on one plate, both flat and without supports.
How the sliding lid holds
The side walls and the back wall have a groove on the inside. Its cross-section is a dovetail: at the bottom the lid rests on a horizontal ledge, above it runs a vertical face, and a 45° roof closes the groove. The lid edge has the same shape with a 45° chamfer on top. So the lid can’t lift out; it can only slide forward.
The front wall ends right below the lid. That’s where you slide it in, and when the box is closed the lid’s front edge becomes the front of the box. The top of the lid is flush with the rim.
The 45° roof is why the box prints without supports: each layer overhangs the one below by at most its own height. In the model the roof is a staircase of 0.2 mm steps, exactly what the slicer prints anyway at a 0.2 mm layer height.
The snap
Near the back wall each side groove has a small triangular bump. The lid edges are separated from the rest of the lid by a narrow slit that is open at the back, so they flex inwards like a finger. When you close the lid, the bump pushes the edge aside until it springs into a matching notch. Because the whole part of the edge that slides past the bump can flex, nothing binds.
“Snap depth” sets how far the bumps reach into the edge: 0.3 mm clicks lightly, the default 0.4 mm keeps the box shut in a bag, 0.6 mm or more snaps much more firmly. Turn the “Snap” off and the lid slides freely, handy for kids or boxes you open all the time. If the box is too short for the flexing finger, the snap is left out automatically and the generator tells you.
Grip and finger notch
At the front of the lid you get either flat “Ribs” or a thumb “Recess”, which help you push the lid forward. The back wall also has a “Finger notch” (16 mm wide by default) where you press against the lid’s back edge. Set it to 0 and the back wall stays closed.
Setting size and fit
| Setting | Range | Default |
|---|---|---|
| Inner width | 10–170 mm | 60 mm |
| Inner length | 15–170 mm | 80 mm |
| Inner height | 4–150 mm | 25 mm |
| Wall thickness | 1.6–4 mm | 2 mm |
| Lid thickness | 1.8–4 mm | 2.4 mm |
| Groove depth | 0.6–2 mm | 1 mm |
| Play | 0–0.6 mm | 0.25 mm |
All sizes are inner sizes. The “Inner height” runs from the floor to the underside of the lid. The outside adds two walls plus “Floor thickness” and “Lid thickness”: the default box, 60 × 80 × 25 mm inside, measures 64 × 84 × 29 mm outside. The generator shows the outer size live below the size fields.
“Groove depth” sets how far the lid edge reaches into the wall. The generator always leaves at least 0.8 mm of wall and of lid edge. If the groove is too deep for that, it makes it shallower and tells you.
The play is the most important value. It’s the gap between lid and groove on each side. 0.25 mm suits most well-tuned printers. At the 45° chamfer the gap grows a little on its own, so the lid doesn’t rub there. If it binds, add 0.05 mm of play and reprint only the lid: set “Parts” to “Lid only”. Below 0.15 mm the generator warns you, because the lid binds on most printers then.
Compartments and card comb
Under “Inside” you split the box. “Cross dividers” run parallel to the front and split the box from front to back; “Lengthwise dividers” run parallel to the sides. One cross divider and two lengthwise ones give you six equal compartments, as in the screw box. “Divider height” is a percentage of the inner height. At 100 % the dividers stay 0.4 mm below the lid so it doesn’t rub. Lower dividers make it easier to get things out, as in the box for AA batteries.
The card comb is a set of ribs on the floor that hold memory cards upright:
| Comb | Card | Minimum inside |
|---|---|---|
| SD | 32 × 24 × 2.1 mm | 33 mm wide, 24.5 mm tall |
| microSD | 15 × 11 × 1 mm | 16 mm wide, 11.5 mm tall |
Every slot is 0.6 mm wider than the card, and the ribs are 1.2 mm thick. The number of cards follows from the inner length and is shown in the “Inside” section: 50 mm of inner length hold twelve SD cards, 35 mm hold twelve microSD cards, as in the tiny box for microSD cards.
Labeling the lid
Under “Label” you write up to 24 characters on the lid and pick a font. You can add a “Symbol” as well: heart, star, house, leaf, letter, bell, arrow or a hazard sign. With text it sits to the left; on its own it fills the middle of the lid. “Text size” defaults to 0, which makes the text as large as fits between the grip and the back wall, keeping clear of the grip ribs and the flex slits.
For “Style” you choose “Raised” or “Engraved”. Raised text stands out of the lid by the “Relief height” (0.6 mm by default). Since nothing is above the lid, it still slides freely. Engraved text sits in the lid, always leaving at least 1 mm of lid below it.
Colors and multi-material printing
The box has three colors: “Box”, “Lid” and “Label”. Left empty, lid and label take the box color. Give them colors of their own and they become separate parts:
- Raised text in its own color is a part standing on the lid.
- Engraved text in its own color fills the engraving flush, like the red heart of the gift box.
Downloads come as “Multi-color 3MF (PrusaSlicer)” for an MMU3, XL or Core One, “3MF (Bambu Studio / OrcaSlicer)” for printers with an AMS, and “STL per color (ZIP)” for any other slicer. With a single nozzle you can still print raised text in two colors: set “Parts” to “Lid only” and add a color change (M600) at the top of the lid in your slicer. With box and lid on the same plate, the upper part of the box would change color too.
Printing tips
- Orientation: as the generator lays them out, the box opening up and the lid top side up. No supports needed.
- Layer height: 0.2 mm. Finer layers make the 45° groove roofs smoother, but they aren’t needed.
- Material: PLA or PETG. The flexing lid edges hold up well in both. PETG is tougher but often wants 0.05 mm more play.
- First layer: elephant’s foot makes the lid’s first layer wider, and that’s exactly the part running in the groove. Turn on the compensation in your slicer or deburr the bottom edge quickly.
- Time and material: the screw box with six compartments takes 38 g of filament and about 1 h 14 min on a Prusa MINI with the “0.20mm SPEED” profile and Prusament PLA. The default box, 60 × 80 × 25 mm inside, needs 41 g and 1 h 12 min, the SD card box 23 g and just under an hour.
With automatic supports turned on, the screw box stayed practically support-free: only one spot under a millimeter showed up in a groove corner, and the weight stayed the same.
Origin and license
The idea comes from 3d-snap-shut-box by FoamyGuy, a small OpenSCAD box for six SD cards released under the Unlicense (public domain). It provides the construction: the lid runs in grooves on both sides and enters over the lowered front, snap bumps in the grooves catch a slit, flexing lid edge, and a finger notch sits at the back. The geometry is rebuilt: the original has round grooves without play that would need supports to print. Here they are 45° dovetail grooves with adjustable play.
The grip ribs on the lid and the adjustable snap go back to ideas from boxee.scad by conyx (CC BY-SA 4.0). No code was taken from it; the implementation is independent. Fonts and symbols are listed with their licenses on the licenses page.
Try it right away in the generator, browse the examples, and if you’re after an open box for stacking, have a look at the stackable storage caddies.
All parameters
The numeric settings of the generator with their default values and allowed ranges. Text, fonts, patterns and colors are set directly in the generator.
| Parameter | Default | Range | Meaning |
|---|---|---|---|
| Size | |||
| Inner width | 60 mm | 10 – 170 mm | Clear width from left to right. The outside adds two walls. |
| Inner length | 80 mm | 15 – 170 mm | Clear length from front to back; the lid slides in this direction. |
| Inner height | 25 mm | 4 – 150 mm | From the floor to the underside of the lid. Floor and lid add to the outside. |
| Wall thickness | 2 mm | 1.6 – 4 mm | Side, front and back walls. The groove takes its depth out of them, leaving at least 0.8 mm. |
| Floor thickness | 1.6 mm | 1 – 4 mm | Thickness of the floor. |
| Corner radius | 2 mm | 0 – 10 mm | Rounding of the vertical outer edges, 0 = square. |
| Lid and fit | |||
| Lid thickness | 2.4 mm | 1.8 – 4 mm | The lid sits flush in the box. Thicker is stiffer but needs more height. |
| Groove depth | 1 mm | 0.6 – 2 mm | How far the lid edge reaches into the side walls. 1 mm holds well and leaves enough wall. |
| Play | 0.25 mm | 0 – 0.6 mm | Gap between lid and groove. 0.25 mm suits most printers; if the lid binds, add 0.05–0.1 mm. |
| Snap depth | 0.4 mm | 0.2 – 0.8 mm | How far the bumps reach into the lid edge. 0.3 mm clicks lightly, 0.6 mm firmly. |
| Finger notch | 16 mm | 0 – 40 mm | Width of the notch in the back wall, where your finger pushes the lid forward. 0 = no notch. |
| Inside | |||
| Cross dividers | 0 | 0 – 9 | Dividers parallel to the front. They split the box from front to back. |
| Lengthwise dividers | 0 | 0 – 9 | Dividers parallel to the sides. They split the box from left to right. |
| Divider thickness | 1.2 mm | 0.8 – 3 mm | 1.2 mm is three lines with a 0.4 mm nozzle. |
| Divider height | 100 % | 20 – 100 % | In percent of the inner height. At 100 % they stay 0.4 mm below the lid. |
| Label | |||
| Text size | 0 mm | 0 – 30 mm | Height of the capital letters, 0 = as large as fits. |
| Relief height | 0.6 mm | 0.4 – 1.6 mm | How far the text stands out, or how deep it is engraved. |
Frequently asked questions
The lid is stuck, what now?
Raise the “Play” by 0.05–0.1 mm and reprint only the lid: set “Parts” to “Lid only”. Elephant’s foot compensation in the slicer often helps too, because the lid’s first layer otherwise comes out slightly wider.
How firmly does the lid snap?
Two small bumps in the grooves click into notches in the lid edges. The default “Snap depth” of 0.4 mm keeps the lid shut in a bag but still lets your thumb push it open. At 0.6 mm it snaps much more firmly; without snap it slides freely.
Do I need supports?
No. The grooves have a 45° roof and the lid lies flat on the bed, top side up. In a test slice with PrusaSlicer’s automatic supports the box stayed practically support-free and the weight did not change.
Do SD and microSD cards fit?
Yes. The “Card comb” holds SD cards (32 × 24 × 2.1 mm) or microSD cards (15 × 11 × 1 mm) upright. SD needs at least 33 mm of inner width and 24.5 mm of inner height, microSD 16 and 11.5 mm.
Can I print the lid in two colors?
Yes. Box, lid and label have their own colors and are exported as separate parts, as 3MF for PrusaSlicer or Bambu Studio. With a single nozzle, print the lid on its own and change the color at its top for raised text.
How large can the box be?
The outside is the inner size plus two walls, so up to 174 mm with 170 mm inside. If box and lid don’t fit side by side on a 180 mm bed, print them one after the other.
Origin & license
- 3d-snap-shut-box by FoamyGuy · Unlicense · dimensions and shape adopted – construction adopted: lid in grooves on both sides, entering over the lowered front, snap bumps on flexible lid edges, finger notch at the back; own geometry with 45° grooves and play instead of round grooves
- boxee.scad by conyx · CC BY-SA 4.0 · idea – ideas: grip ribs on the sliding lid, adjustable snap strength (own implementation, no code taken)