Documentation
Sidebyside — Product Comparison Page
Version 1.0.0 · Vanilla HTML · 10 files · 41 KB
Getting started
- Unzip the download and open index.html in a browser. No server, installation or build step is needed.
- Edit the text directly in the HTML files.
- Change colours, fonts and spacing through the CSS custom properties at the top of assets/css/style.css.
- Replace the artwork in assets/images/ with your own images.
- Upload the whole folder to any static host.
File structure
The download contains these 10 files:
- LICENSE.txt1.7 KB
- README.md2.4 KB
- assets/css/style.css13 KB
- assets/fonts/familjen-grotesk-LICENSE.txt4.4 KB
- assets/fonts/familjen-grotesk-latin-wght-normal.woff218 KB
- assets/images/favicon.svg413 B
- assets/js/main.js15 KB
- documentation/index.html11 KB
- documentation/licenses/lucide-LICENSE.txt3.1 KB
- index.html5.1 KB
Colours
These custom properties are defined at the top of the stylesheet. Change a value once and it updates everywhere it is used.
--color-bg#ffffff--color-soft#f6f7fb--color-ink#111827--color-muted#4b5563--color-line#e2e5ee--color-indigo#6366f1--color-indigo-deep#4338ca--color-indigo-soft#eef0ff--color-good#15803d--color-good-bg#e7f8ee--color-bad#b91c1c--color-bad-bg#fdecec
Interactive features
Products and specifications
Edit the PRODUCTS array and the ROWS list at the top of assets/js/main.js. Each ROWS entry is [group, key, label, better, formatter]; set better to 'high', 'low' or null.
Selection limits
Change MAX, MIN and DEFAULT_SELECTION in assets/js/main.js.
Best value
bestValueId() divides the score field by price; replace it with your own formula if you rank value differently.
Highlight and hide toggles
The two checkboxes #t-diff and #t-hide set state.diff and state.hide; defaults can be changed in the state object and the checked attribute.
Customisation notes
Use photographs
Replace laptopSvg() in main.js with a function that returns an img element using a new image field on each product.
Compare other products
Rename the groups and rows in ROWS and the matching fields in PRODUCTS; the table, highlighting and hiding logic are generic.
Column width on phones
--label-w in :root sets the pinned label column; product columns are sized so exactly two fit the viewport.
Highlight colours
--color-good, --color-bad and --color-indigo with their background tokens control the markers.
What is front-end only
This is a front-end template. The behaviours below are demonstrations that run in the browser; connect them to your own server or service before relying on them.
- All products, prices, review scores and benchmark numbers are fictional sample data.
- There is no purchase flow; the page only compares.
Bundled components and licences
Everything the template needs is inside the download; nothing is loaded from the network.
- Familjen Grotesk typeface — OFL-1.1 (
assets/fonts/familjen-grotesk-LICENSE.txt) - Lucide icons (inlined SVG) — ISC (
documentation/licenses/lucide-LICENSE.txt)
Changelog
Version 1.0.0 · Nov 23, 2026
- Initial release.