One screenshot
A screenshots page shows every screen. Sometimes a page needs just one: the overview at the top of the docs, the dashboard in a README. Each gallery library can render one screenshot from the same manifest: an <img>, or a <picture> that shows the dark shot to readers whose setting is dark. It has its width and height set, so the page doesn't jump while it loads, and it's lazy-loaded unless you ask otherwise.
It needs no stylesheet or script. Install the library for your stack as its guide says; every snippet below is a file from that library's example site, which VisualCI's tests build and check.
In a framework
Each framework's package has a Screenshot component next to its Gallery. It reads the manifest when the site builds, and the build fails when the manifest can't be read or the screen isn't in it.
React and Next.js, a server component:
import { Screenshot } from "visualci-gallery-react";
export const metadata = { title: "Overview" };
export default function Overview() {
return (
<>
<h1>Overview</h1>
{/* One screenshot, in the reader's light or dark mode, linked to the full-size original. */}
<Screenshot manifest="https://app.visualci.com/g/acme/web.json" screen="overview" link />
</>
);
}
---
import { Screenshot } from "visualci-astro-gallery";
---
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Overview</title>
</head>
<body>
<h1>Overview</h1>
<!-- One screenshot, in the reader's light or dark mode, linked to the full-size original. -->
<Screenshot manifest="https://app.visualci.com/g/acme/web.json" screen="overview" link />
</body>
</html>
Docusaurus, with the plugin in docusaurus.config.js as for a gallery:
---
title: Overview
---
import Screenshot from "visualci-gallery-docusaurus/Screenshot";
One screenshot, in the reader's light or dark mode, linked to the full-size original.
<Screenshot manifest="https://app.visualci.com/g/acme/web.json" screen="overview" link />
VitePress, with the plugin and the theme as for a gallery (the theme registers <Screenshot> too):
# Overview
One screenshot, in the reader's light or dark mode, linked to the full-size original.
<Screenshot manifest="https://app.visualci.com/g/acme/web.json" screen="overview" link />
MkDocs, a visualci-screenshot fenced block in any page:
# Overview
One screenshot, in the reader's light or dark mode, linked to the full-size original.
```visualci-screenshot
manifest: https://app.visualci.com/g/acme/web.json
screen: overview
link: true
```
Hugo, a visualci-screenshot shortcode in any page (or the visualci-screenshot.html partial in a template, which takes markdown: true for Markdown):
---
title: Overview
---
One screenshot, in the reader's light or dark mode, linked to the full-size original.
{{< visualci-screenshot manifest="https://app.visualci.com/g/acme/web.json" screen="overview" link=true >}}
In your own code
The libraries have two functions that take a parsed manifest and the options below, and return a string:
screenshotreturns the HTML.screenshotMarkdown(screenshot_markdownin Ruby, Python and Rust) returns Markdown for a README:, or[](url)withlink. When the screen has a dark shot it returns the HTML<picture>, which GitHub and most Markdown renderers show as it is.
Both raise an error when an option is invalid or the screen has no shot for what's asked. A script that writes your README when the build passes can call screenshotMarkdown with the manifest it fetched. For a screen with no dark shot, it returns:

and for one with a dark shot:
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://app.visualci.com/g/acme/web/overview-dark-1440.png" width="1440" height="900">
<img src="https://app.visualci.com/g/acme/web/overview-light-1440.png" srcset="https://app.visualci.com/g/acme/web/overview-light-1440.png, https://app.visualci.com/g/acme/web/overview-light-1440-2x.png 2x" width="1440" height="900" alt="Overview" loading="lazy" decoding="async">
</picture>
A Markdown image shows at the file's own size, so a README that wants a smaller picture uses thumb, or a screen taken at a smaller width.
Options
screen(required): the screen's key, as the gallery'sscreensandordername it:overview,ios/sessions.group: the group it's in. Default: the first group that has the screen.theme: the theme to show, such aslight. Default: the screen's first, with its dark shot for readers whose setting is dark. When you set it, only that theme's shot is shown.size: the size to show, such asphone. Default: the screen's first that has the theme.alt: the image's alt text. Default: the screen's title, made from its key.link: link the image to its full-size original. Default false.thumb: show the manifest's small copy, where every image shown has one. Default false.loading:lazy(the default) oreager, for a screenshot near the top of the page.dimensionsandgroups: as the gallery's options of the same names, so the screen's shots pair the same way they do in your gallery.
Shots that only come as 2x files are shown at half their size, with the 2x file for sharp screens.