On the screen

Media and documents

Most products handle more than plain text: videos to stream, sounds to play, drawings and 3D models to show, photos to shrink, barcodes to scan, PDFs to create and articles to write. Each kind of media has its own formats and tools, and modern browsers already handle much of the work.

Video is usually delivered with HLS and shown in a player such as Video.js, while the Web Audio API handles sound. Graphics go through the Canvas API, with Fabric.js for editable 2D and Three.js for 3D. sharp and ZXing work on images and barcodes, a few libraries create and display PDFs, and Markdown and MDX hold written content.

14 terms · 3 comparisons · prices checked September 2026

14 terms, click any to open

Video and audio

HLS streaming

ProtocolFree
Apple's way of streaming video over ordinary web servers: the video is cut into short chunks at several qualities, and the player switches quality as the viewer's connection changes.

An encoder (often FFmpeg, or a hosted service) turns one source video into several renditions, for example 1080p, 720p and 480p, and slices each into segments a few seconds long. Plain-text playlists with the .m3u8 extension list the segments, and a main (multivariant) playlist lists the renditions. The player reads the playlists, then downloads segments one after another, choosing the highest quality the connection can sustain and switching as conditions change.

Because it is just files over HTTP, HLS works with any web server or CDN and caches well. Apple introduced it in 2009, and it is published as RFC 8216. The same approach carries live streams, and Low-Latency HLS brings the delay down to a few seconds. Safari and recent versions of Chrome play it natively; other browsers use a JavaScript player such as hls.js or Video.js, built on Media Source Extensions.

MPEG-DASH is the main open alternative, and DRM systems such as FairPlay and Widevine protect paid content. The hard parts are encoding every upload into several renditions and paying for storage and bandwidth, which is why hosted services such as Mux, Cloudflare Stream and Bunny Stream, or AWS Elemental MediaConvert with a CDN, are common.

Pros

  • Adapts quality to each viewer's connection, so playback rarely stalls
  • Plain HTTP files, so any CDN can cache and deliver them
  • Plays natively on iPhone, iPad, Mac and recent versions of Chrome
  • Handles both on-demand and live video
  • Starts quickly, without downloading the whole file first

Cons

  • Needs an encoding step to produce the renditions and playlists
  • Firefox and some other browsers need a JavaScript player
  • Live delay is higher than WebRTC, even with Low-Latency HLS
  • Several renditions per video add storage and bandwidth costs

Pick it when

  • Videos longer than a short clip, watched on connections of varying speed
  • Live streams to many viewers at once
  • Courses, films or paid content that may need DRM later

Skip it when

  • Short, small clips where a plain MP4 file is simpler
  • Calls or interactive streams that need sub-second delay (WebRTC fits better)

What it costs · Free

The protocol is free. Hosting costs money: Cloudflare Stream charges about $5 a month per 1,000 minutes stored and $1 per 1,000 minutes watched; Mux has a free plan for up to 10 videos.

Approximate, checked September 2026.

Also called: HTTP Live Streaming, m3u8, adaptive bitrate streaming, LL-HLS, hls.js

Open HLS streaming as a pageOfficial site (opens in a new tab)

Video.js

LibraryOpen source
A free, open-source web video player that looks and behaves the same in every browser and can play streaming formats such as HLS and DASH.

Video.js wraps the browser's video element in a skinnable, accessible control bar with captions and subtitles, keyboard shortcuts, fullscreen and picture-in-picture, plus a plugin system for ads, analytics, quality menus and playlists. Its built-in streaming engine plays HLS and DASH even in browsers that cannot do so natively. The project began in 2010 and is widely used by media sites and video platforms.

Version 10 is a ground-up rewrite, made together with the teams behind Plyr, Vidstack and Media Chrome, with much smaller bundles and first-class React and TypeScript support; earlier versions remain widely deployed. Alternatives include Google's Shaka Player, hls.js on its own for streaming, or the player that a video host provides.

What it costs · Open source

Free (Apache 2.0).

Approximate, checked September 2026.

Also called: videojs, video.js player, HTML5 video player

Open Video.js as a pageOfficial site (opens in a new tab)

Web Audio API

APIFree
A browser feature for generating, processing and analysing sound in real time, used for games, music tools, audio visualisers and voice apps.

Everything happens inside an AudioContext, where you connect nodes into a graph: sources (an oscillator, a decoded sound file, a microphone stream), processing nodes (volume, filters, delay, reverb, stereo panning, compression) and a destination, usually the speakers. An AnalyserNode exposes frequency and waveform data for visualisers, and AudioWorklet runs custom processing code on the audio thread, so busy page scripts do not interrupt the sound.

It is lower level than an audio element, which is enough for simply playing a file. Browsers only let a page start sound after a user gesture such as a click, so an AudioContext begins suspended until then. Libraries such as Tone.js (music and synthesis) and Howler.js (game and interface sounds) build on it.

What it costs · Free

Free; it is part of the browser.

Approximate, checked September 2026.

Also called: AudioContext, Web Audio, AudioWorklet

Open Web Audio API as a pageOfficial site (opens in a new tab)

Graphics and 3D

Canvas API

APIFree
A browser feature that gives a web page a blank drawing surface, where code paints shapes, images, text and animation pixel by pixel.

A canvas element and its 2D context offer drawing commands for rectangles, paths, arcs, gradients, images, text and transforms, plus direct access to the pixel data. The browser keeps only the resulting pixels, not the shapes, so moving something means clearing and redrawing, usually every frame with requestAnimationFrame. The same element hosts WebGL and WebGPU for 3D, and OffscreenCanvas lets drawing run in a web worker.

It is used for charts, games, image editors, signature pads, photo filters and exporting pictures with toDataURL or toBlob. Because the content is only pixels, screen readers and search engines cannot read it without text alternatives, and working out which shape a click landed on is up to you. SVG suits a smaller number of interactive shapes, and libraries such as Fabric.js and Konva add an object layer on top of canvas.

What it costs · Free

Free; it is part of the browser.

Approximate, checked September 2026.

Also called: HTML canvas, canvas element, 2D context, OffscreenCanvas

Open Canvas API as a pageOfficial site (opens in a new tab)

Fabric.js

LibraryOpen source
A JavaScript library that turns an HTML canvas into an editable drawing board, where shapes, text and images can be selected, moved, resized and rotated.

Fabric.js keeps an object model on top of the canvas: every rectangle, circle, path, text box or image is an object with properties, and the library draws selection handles and takes care of dragging, scaling, rotation, grouping, layering and free drawing with brushes. It imports and exports SVG and can save a whole scene as JSON to load again later, which is what design tools need.

Typical uses are T-shirt and product customisers, banner and meme makers, whiteboards, image annotation and certificate or label designers. It runs in the browser and, through node-canvas, in Node for rendering on a server. Konva is a similar library with official React bindings (react-konva); for 3D, Three.js is the usual choice.

What it costs · Open source

Free (MIT).

Approximate, checked September 2026.

Also called: Fabric, fabric.js, FabricJS

Open Fabric.js as a pageOfficial site (opens in a new tab)

Three.js

LibraryOpen source
A popular JavaScript library for interactive 3D graphics in the browser, from product viewers and games to animated website backgrounds.

Raw WebGL, the browser's low-level 3D interface, needs a lot of code just to draw a lit cube. Three.js wraps it in familiar ideas: a scene holds meshes (a geometry plus a material), lights and cameras, and a renderer draws the scene into a canvas every frame. It includes loaders for 3D models (glTF is the usual format), physically based materials, shadows, post-processing effects and camera controls, and it also offers a WebGPU renderer.

Ricardo Cabello (mrdoob) started it in 2010, and a large ecosystem has grown around it: React Three Fiber lets React developers build scenes as components, drei adds ready-made helpers, and physics engines such as Rapier or cannon-es plug in. Babylon.js is the main alternative, with more built in for games; for flat 2D graphics, the Canvas API or SVG is lighter.

The hard parts are rarely the code. Models and textures must be optimised (compressed, with fewer polygons) to keep downloads small, and scenes need testing on low-end phones, where the graphics chip and battery limit what runs smoothly.

Pros

  • Far less code than raw WebGL, with a large gallery of examples
  • Loads standard 3D models such as glTF
  • Big ecosystem, including React Three Fiber and drei
  • Runs in every modern browser without plugins
  • MIT licensed and free

Cons

  • Frequent releases that often include breaking changes
  • 3D assets can be large and slow to load on mobile
  • Needs some 3D knowledge (cameras, lights, materials) to look good
  • Content inside the canvas is invisible to screen readers and search engines

Pick it when

  • Product viewers and configurators that customers can rotate
  • Interactive hero sections and brand experiences
  • Data visualisations or maps that need real depth
  • Browser games and simple simulations

Skip it when

  • 2D charts or diagrams, where SVG or canvas is lighter
  • A full game engine is needed (Babylon.js, Unity or Godot fit better)

What it costs · Open source

Free (MIT).

Approximate, checked September 2026.

Also called: three, three.js, WebGL library, React Three Fiber, R3F

Open Three.js as a pageOfficial site (opens in a new tab)

Images

sharp

LibraryOpen source
A fast Node.js library for resizing, cropping, compressing and converting images, often used on servers to make thumbnails and modern formats such as WebP and AVIF.

sharp wraps libvips, a C image library that processes pictures in small chunks, so it is quick and uses little memory even on large files. It reads JPEG, PNG, WebP, AVIF, GIF, TIFF and SVG, and can resize, crop, rotate according to camera EXIF data, blur, sharpen, composite watermarks, strip metadata and write modern formats, all through a chained API such as sharp(input).resize(800).webp().

It powers image optimisation in many tools, including Next.js when self-hosted, Astro and Gatsby. Prebuilt native binaries cover the common platforms, and it runs under Node, Bun and Deno, but it needs a server runtime: it does not run in the browser, and edge platforms such as Cloudflare Workers usually rely on their own image services instead.

What it costs · Open source

Free (Apache 2.0).

Approximate, checked September 2026.

Also called: sharp.js, libvips, Node image resizing

Open sharp as a pageOfficial site (opens in a new tab)

ZXing

LibraryOpen source
An open-source library for reading and creating barcodes and QR codes from images or a live camera feed, first written in Java and ported to many languages.

ZXing ('zebra crossing') decodes 1D barcodes such as EAN-13, UPC-A, Code 39 and Code 128 and 2D codes such as QR Code, Data Matrix, Aztec and PDF417, and it can generate them as well. It began at Google and powered the well-known Barcode Scanner app on Android. Ports include zxing-js for JavaScript and zxing-cpp, a C++ version that also compiles to WebAssembly for fast scanning in the browser.

The original Java project and the JavaScript port are now in maintenance mode and accept only bug fixes, so new projects often use zxing-cpp builds, the browser's BarcodeDetector API where it is available, ML Kit on Android or Apple's Vision framework on iOS. Scanning quality depends as much on the camera, focus and lighting as on the library.

What it costs · Open source

Free (Apache 2.0).

Approximate, checked September 2026.

Also called: zebra crossing, zxing-js, zxing-cpp, barcode scanner, QR code reader

Open ZXing as a pageOfficial site (opens in a new tab)

PDFs

pdf-lib

LibraryOpen source
A JavaScript library for creating PDFs and editing existing ones: filling in forms, adding or copying pages, stamping text and images, and merging or splitting files.

pdf-lib is written in TypeScript with no native parts, so it runs in browsers, Node, Deno and React Native. You work page by page: add a page of a given size, draw text, lines, shapes and embedded PNG or JPEG images at x and y coordinates, embed custom fonts, fill and flatten form fields, copy pages between documents, and set metadata.

There is no layout engine: beyond basic line wrapping you place everything yourself, and long text does not flow onto new pages. It cannot display a PDF either (PDF.js does that). It suits templates designed elsewhere, such as stamping a name onto a certificate or filling in an official form. Development of the original package has slowed, and the actively maintained fork @cantoo/pdf-lib adds encryption, full SVG drawing and other fixes.

What it costs · Open source

Free (MIT).

Approximate, checked September 2026.

Also called: pdflib, @cantoo/pdf-lib

Open pdf-lib as a pageOfficial site (opens in a new tab)

react-pdf

LibraryOpen source
A React component library for showing existing PDF files inside a web page, page by page, with text that can be selected and links that work.

react-pdf wraps Mozilla's PDF.js, the engine behind Firefox's built-in PDF viewer. A Document component loads a file from a URL or from data, and Page components render each page to a canvas, with optional text and annotation layers so text can be selected and links clicked. The PDF.js worker has to be configured so that parsing runs off the main thread.

It displays PDFs; it does not create them, and its similar name often causes confusion with @react-pdf/renderer, which generates PDFs from React components. Toolbars, search, zoom and thumbnails are yours to build, or you can use PDF.js's own viewer or a commercial viewer SDK. For long files, rendering only the pages on screen keeps memory use down.

What it costs · Open source

Free (MIT).

Approximate, checked September 2026.

Also called: react-pdf viewer, PDF viewer for React

Open react-pdf as a pageOfficial site (opens in a new tab)

@react-pdf/renderer

LibraryOpen source
A library for generating PDF documents with React components, so invoices, reports and tickets are designed much like web pages and saved as real PDFs.

Instead of HTML elements you use its own building blocks, such as Document, Page, View, Text, Image and Link, styled with a subset of CSS and laid out with flexbox through the Yoga layout engine. Text wraps and flows across pages on its own, headers and footers repeat with the fixed prop, and page numbers come from a render function. Custom fonts are registered once, and SVG drawing is supported.

It runs in the browser, with a preview component and download links, and in Node, where renderToFile, renderToStream or renderToBuffer build files on a server. It does not render HTML or Tailwind classes, so existing web components cannot be reused directly, and very large documents take a while to build. When a PDF must match an existing web page exactly, a headless browser such as Puppeteer is the usual alternative.

What it costs · Open source

Free (MIT).

Approximate, checked September 2026.

Also called: react-pdf renderer, React PDF

Open @react-pdf/renderer as a pageOfficial site (opens in a new tab)

Writing formats

Markdown

FormatFree
A simple way to write formatted text with ordinary characters, such as # for a heading and * for emphasis, that reads well as it is and converts cleanly to HTML.

John Gruber created Markdown in 2004, with Aaron Swartz, so that text would stay readable before any conversion. The original description left many edge cases open, so CommonMark defined a precise specification in 2014, and GitHub Flavored Markdown adds tables, task lists, strikethrough and automatic links on top. Front matter, a YAML block at the top of a file, is a common add-on for titles, dates and tags.

It is used for READMEs, documentation, blogs, notes apps, chat messages and the output of AI models. Libraries such as marked, markdown-it, remark and react-markdown turn it into HTML. Because Markdown allows raw HTML, anything written by untrusted users should be sanitised after conversion to prevent XSS. MDX extends it with components.

What it costs · Free

Free to use; it is an open, plain-text format.

Approximate, checked September 2026.

Also called: md, CommonMark, GFM, GitHub Flavored Markdown

Open Markdown as a pageOfficial site (opens in a new tab)

MDX

FormatOpen source
Markdown that can also contain React-style components, so a blog post or documentation page can include live charts, callouts, tabs or interactive demos.

An MDX file is compiled to JavaScript. Headings, lists and links are written as ordinary Markdown, and between them you can import and place JSX components such as a chart with its data, use JavaScript expressions in curly braces, and export values. It works with React, Preact, Vue and other JSX runtimes, and frameworks such as Next.js, Astro, Docusaurus and Nextra support it; remark and rehype plugins add GFM tables, maths and syntax highlighting.

It is stricter than Markdown. Raw HTML must be valid JSX, characters such as < and { need escaping, and indented code blocks and angle-bracket autolinks are not supported, so converting existing Markdown takes some clean-up. Because MDX compiles to code, content from untrusted users should never be compiled as MDX.

What it costs · Open source

Free (MIT).

Approximate, checked September 2026.

Also called: .mdx, Markdown with JSX, @mdx-js/mdx

Open MDX as a pageOfficial site (opens in a new tab)

highlight.js

LibraryOpen source
A JavaScript library that colours code snippets on web pages according to their programming language, the way a code editor does.

highlight.js turns the text inside pre and code blocks into spans with classes such as hljs-keyword and hljs-string, which a theme stylesheet then colours. It ships grammars for nearly 200 languages and a wide choice of themes, can guess the language when none is given, and runs in the browser, in Node or in a build step. Importing only the languages you need keeps the bundle small.

It only highlights: line numbers, copy buttons and editing come from plugins or your own code. Prism is a similar lightweight option, and Shiki uses the same grammars as VS Code for more accurate colours, usually at build time. For editable code, an editor such as CodeMirror or Monaco is the right tool.

What it costs · Open source

Free (BSD 3-Clause).

Approximate, checked September 2026.

Also called: hljs, highlightjs, syntax highlighting

Open highlight.js as a pageOfficial site (opens in a new tab)

Side by side

Differences

How the options in this area compare on the questions that usually decide the choice.

pdf-lib vs @react-pdf/renderer vs Puppeteer

Open as a page: pdf-lib vs @react-pdf/renderer vs Puppeteer

Three common ways to produce PDFs with JavaScript: draw on PDF pages directly, describe the document with React components, or print a real web page in a headless browser.

Comparepdf-lib@react-pdf/rendererPuppeteer
How it worksDraws text and images at coordinatesReact components laid out with flexboxHeadless Chrome prints an HTML page
Best forFilling forms and stamping templatesInvoices, reports and tickets from dataExact copies of existing web pages
LayoutManual positioningAutomatic wrapping and page breaksFull HTML and CSS
Edits existing PDFsYes: merge, split, fill formsNo, creates new files onlyNo, creates new files only
Runs inBrowser, Node, Deno, React NativeBrowser and NodeNode on a server with Chrome
StylingFonts, colours and shapes in codeA subset of CSSAny CSS, including Tailwind
WeightSmall, pure JavaScriptModerate, pure JavaScriptHeavy: downloads a full browser
ServerlessWorks almost anywhereWorks in most functionsNeeds a slimmed-down Chromium or a hosted service

How to choose

  • Pick pdf-lib to fill, stamp, merge or split PDFs that already exist.
  • Pick @react-pdf/renderer to generate structured documents such as invoices from data, in the browser or on a server.
  • Pick Puppeteer when the PDF must match an HTML page exactly and you can run a headless browser.

Canvas API vs Fabric.js vs Three.js

Open as a page: Canvas API vs Fabric.js vs Three.js

All three draw into a canvas element. The difference is how much they do for you: raw pixels, editable 2D objects, or complete 3D scenes.

CompareCanvas APIFabric.jsThree.js
What it isA drawing API built into browsersA 2D object library on top of canvasA 3D library on WebGL and WebGPU
Dimensions2D (3D through WebGL)2D3D
Remembers shapesNo, only pixelsYes, every object stays editableYes, in a scene graph
User editingBuild it yourselfSelect, drag, resize and rotate built inCamera controls; editing is custom
Save and loadExport as an imageJSON and SVGglTF models and JSON scenes
Download sizeNothing extra, it is in the browserA moderate libraryA larger library, plus 3D assets
Best forCharts, games, filters, signaturesDesign tools and product customisersProduct viewers, 3D scenes and games
Learning curveEasy start, grows with featuresGentle for editing featuresSteeper: cameras, lights, materials

How to choose

  • Use the Canvas API directly for simple drawing, charts or games where you control every frame.
  • Pick Fabric.js when users need to add, move and edit shapes, text and images.
  • Pick Three.js for anything that needs depth, lighting or 3D models.

MDX is Markdown plus components. The extra power suits interactive docs and blogs, but it makes files stricter and turns content into code.

CompareMarkdownMDX
What it isPlain-text formatting syntaxMarkdown plus JSX components
OutputHTMLJavaScript components that render HTML
Components and codeNone; raw HTML at mostImports, JSX and JavaScript expressions
StrictnessForgiving; mistakes still renderStrict; a typo can break the build
Where it worksAlmost everywhere: GitHub, editors, CMSs, chatSites with an MDX build step or runtime
Untrusted contentFine once the HTML is sanitisedNever compile MDX written by users
Best forREADMEs, notes and simple blog postsDocs and blogs with interactive parts

How to choose

  • Pick Markdown for portable content that many tools and writers can edit.
  • Pick MDX when pages need live components such as charts, tabs or demos, and a developer looks after the build.
  • Most MDX setups also accept plain .md files, so a site can mix both.

Crafted in the dark. Shipped to the world.

Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.