Viewport Presets
Control the viewport size to capture screenshots at different device dimensions. DomShot provides presets for common devices or you can define custom dimensions.Preset viewports
| Preset | Width | Height | Device Scale Factor |
|---|---|---|---|
mobile | 375px | 812px | 3x |
tablet | 768px | 1024px | 2x |
desktop | 1920px | 1080px | 1x |
Mobile
bash
Tablet
bash
Desktop
bash
Custom viewport
bash
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
viewportType | string | desktop | mobile, tablet, desktop, or custom |
width | number | 1920 | Custom viewport width (required when viewportType=custom) |
height | number | 1080 | Custom viewport height (required when viewportType=custom) |
deviceScaleFactor | number | 1 | Device pixel ratio for high-DPI displays |
Device scale factor
The device scale factor controls the pixel density for capturing screenshots on high-DPI displays:- 1x - Standard displays (desktop default)
- 2x - Retina displays (tablet default)
- 3x - Super Retina displays (mobile default)
See also
- Full Page Screenshots - Capture entire page length
- Image Formats - PNG, JPEG, WebP options