Platforms
Target specific social platforms
OGX includes built-in dimensions for common social media platforms.
Available Platforms
| Platform | Dimensions | Aspect Ratio |
|---|---|---|
meta | 1200x630 | 1.91:1 |
twitter | 1200x600 | 2:1 |
instagram | 1080x1080 | 1:1 |
pinterest | 1000x1500 | 2:3 |
youtube | 1280x720 | 16:9 |
marketplace | 1200x1200 | 1:1 |
Usage
import { ogx } from '@ogxjs/core';
const png = await ogx({
preset: 'social',
title: 'My Post',
platform: 'instagram',
});Get Dimensions
Access platform dimensions directly:
import { getPlatformDimensions } from '@ogxjs/core';
const dims = getPlatformDimensions('instagram');
// { width: 1080, height: 1080 }Custom Dimensions
Override with explicit values:
const png = await ogx({
preset: 'docs',
title: 'Custom Size',
width: 1600,
height: 900,
});