How do I override styles at render time?
Send dot-notation style parameters to change fonts, colors and sizes per render without editing the template.
Updated
Custom Style Parameters allow you to dynamically override individual CSS properties of parameterized elements at render time. While regular parameters control content (text, images), style parameters give you precise control over visual properties like colors, fonts, sizes, and more.
Video Tutorial#
How It Works#
Custom style parameters use a dot notation format: parameterId.property
For example:
title.fontSize- Changes the font size of a text element with parameter ID "title"logo.borderRadius- Changes the border radius of an image element with parameter ID "logo"badge.fill- Changes the fill color of a shape element with parameter ID "badge"
Syntax Format#
Single Page Templates#
{
"templateId": 123,
"modifications": {
"title": "Hello World",
"title.fontSize": "48px",
"title.color": "#ff0000",
"title.fontFamily": "Roboto"
}
}Multi-Page Templates#
For multi-page templates, use the page prefix:
{
"templateId": 123,
"modifications": {
"page1@title": "Page 1 Title",
"page1@title.fontSize": "48px",
"page2@title": "Page 2 Title",
"page2@title.color": "#0000ff"
}
}Supported Properties#
Text Elements#
Typography
fontSize- Font size (e.g., "24px", "2rem")fontWeight- Font weight (e.g., "bold", "400", "700")fontStyle- Font style (e.g., "italic", "normal")fontFamily- Font family: any Google Font, or the family name of a font uploaded to your workspacelineHeight- Line height (e.g., "1.5", "24px")letterSpacing- Letter spacing (e.g., "0.05em", "2px")
Alignment & Decoration
textAlign- Text alignment ("left", "center", "right")verticalAlign- Vertical alignment: "flex-start" (top), "center" or "flex-end" (bottom). Any other value aligns to the toptextDecoration- Text decoration ("underline", "none")textTransform- Text transform ("uppercase", "lowercase", "capitalize")
Colors & Effects
color- Text color (e.g., "#ff0000", "rgba(255, 0, 0, 0.5)")backgroundColor(orbackground,bgColor,bg) - Text background colorbackgroundRadius(orbgRadius) - Text background border radiustextStrokeWidth- Stroke width (e.g., "2px")textStrokeColor- Stroke color
Shadows & Effects
dropShadowX- Shadow horizontal offsetdropShadowY- Shadow vertical offsetdropShadowBlur- Shadow blur radiusdropShadowColor- Shadow coloropacity- Element opacity (0 to 1)filter- CSS filter effects
Image Elements#
Layout
objectFit- Object fit ("contain", "cover", "fill")objectPosition- Object position (e.g., "center center", "top left")
Border
borderRadius- Border radius (e.g., "10px", "50%")borderWidth- Border width (e.g., "2px")borderColor- Border color
Shadow
boxShadowX- Box shadow horizontal offsetboxShadowY- Box shadow vertical offsetboxShadowBlur- Box shadow blur radiusboxShadowColor- Box shadow color
Effects
opacity- Image opacity (0 to 1)filter- CSS filter effectsdropShadowX,dropShadowY,dropShadowBlur,dropShadowColor- Drop shadow
Shape Elements#
Colors
fill- Fill color (supports gradients)stroke- Stroke colorstrokeWidth- Stroke width
Border & Effects
borderRadius- Corner radius (for rectangles/circles)opacity- Shape opacity (0 to 1)dropShadowX,dropShadowY,dropShadowBlur,dropShadowColor- Drop shadow
Position and Size (all elements)#
x,y- Move the layer, in pixels from the page's top-left corner (e.g.,"logo.x": "120px"or120)width,height- Resize the layer, in pixels, or"auto"to size it to its content
A value of 0 keeps the layer's saved position or size.
Property Name Variations#
Common property names are case-insensitive, and a few have aliases. For text background color, title.backgroundColor, title.background, title.bgColor and title.bg all work. For font size, title.fontSize, title.fontsize and title.FONTSIZE all work.
Case-insensitive names: fontSize, fontWeight, fontStyle, lineHeight, letterSpacing, textAlign, verticalAlign, textDecoration, textTransform, textStrokeWidth, textStrokeColor, backgroundColor, backgroundRadius, borderRadius, borderWidth, borderColor, objectFit, objectPosition, strokeWidth, the dropShadow* and boxShadow* properties, x, y, width and height.
Write every other property exactly as shown on this page, in the same case: color, fill, stroke, opacity and filter. Always write fontFamily in this exact case. With any other spelling the family name is applied, but its font file is not loaded.
Finding Style Parameters in Studio#
To see the style parameters for a layer:
- Select the layer in Orshot Studio
- Open the API tab in the right sidebar
- Copy the style parameter examples shown for that layer
Then send them in a test render, for example from the template's Connect sheet.
Using with Dynamic URLs#
Custom style parameters work with Dynamic URLs. Add them as query parameters:
https://api.orshot.com/v1/studio/dynamic-url/example.jpg?templateId=123&title.fontSize=48px&title.color=%23ff0000&sign=YOUR_SIGNATURENote: URL-encode special characters (e.g., # becomes %23). See Dynamic URLs for how to sign the URL.
Using with API#
Include style parameters in your API requests:
curl -X POST https://api.orshot.com/v1/studio/render \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"templateId": 123,
"modifications": {
"title": "Dynamic Title",
"title.fontSize": "48px",
"title.color": "#ff0000",
"title.fontFamily": "Playfair Display",
"logo.borderRadius": "50%",
"badge.fill": "linear-gradient(to right, #ff0000, #0000ff)"
},
"response": {
"format": "png",
"type": "url"
}
}'Font Support#
The fontFamily style parameter loads the font for you when it renders:
{
"title.fontFamily": "Playfair Display",
"subtitle.fontFamily": "My Brand Font"
}Orshot first looks for a font with that family name among the fonts uploaded to your workspace. If there is none, it loads the font from Google Fonts. See Custom Fonts to upload your own.
When an uploaded family has the same name as a Google font (an uploaded "Inter" next to Google's Inter), the text keeps the one picked in the editor. fontSource switches it per render: "custom" renders the uploaded files, "google" the Google font.
{
"title.fontSource": "google",
"subtitle.fontSource": "custom"
}Changing fontFamily to another family resets the source to that family's own files.
Practical Examples#
Dynamic Theming#
Brand blue titles, gray subtitles, a matching badge and a rounded logo:
{
"templateId": 123,
"modifications": {
"name": "John Doe",
"title.color": "#1e40af",
"subtitle.color": "#64748b",
"badge.fill": "#1e40af",
"logo.borderRadius": "10px"
}
}Personalized Styles#
A circular avatar and a larger, bold, black username:
{
"templateId": 123,
"modifications": {
"username": "@johndoe",
"avatar": "https://example.com/avatar.jpg",
"avatar.borderRadius": "50%",
"username.fontSize": "24px",
"username.fontWeight": "bold",
"username.color": "#000000"
}
}Gradient Effects#
{
"templateId": 123,
"modifications": {
"title": "Welcome",
"background.fill": "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
"title.color": "#ffffff",
"title.textStrokeWidth": "2px",
"title.textStrokeColor": "#000000"
}
}Responsive Typography#
A larger font for a short quote with comfortable line height, and a smaller italic author line:
{
"templateId": 123,
"modifications": {
"quote": "Short quote",
"author": "Author Name",
"quote.fontSize": "36px",
"quote.lineHeight": "1.4",
"author.fontSize": "16px",
"author.fontStyle": "italic"
}
}Important Notes#
Property Validation#
- Only valid CSS values are applied
- Invalid values are ignored (element uses default styles)
- Common property names are case-insensitive (see Property Name Variations)
- Aliases supported for text background color and radius
Parameter ID Requirements#
- Must match an existing parameterized element
- Cannot contain
.(dot),@,:(colon) or spaces in the parameter ID itself - Use the exact ID shown in the layer's API tab
Priority Order#
Style parameters have the highest priority:
- Custom style parameters (highest)
- Regular parameter values
- Template default styles (lowest)
Performance#
- Style parameters are processed during render time
- Google Fonts are cached and loaded efficiently
- No performance impact on templates without style parameters
Best Practices#
Use Consistent Units: Stick to px, rem, or % for sizes
Test First: Send a test render to check styles before production use
Document Your Styles: Keep a reference of available style parameters for your templates
Use Exact Names: Write property names as shown on this page, so case never matters
Combine with Regular Parameters: Use both content and style parameters for maximum flexibility
Validate Input: In your application, validate CSS values before sending to API
Consider Fallbacks: Design templates with sensible defaults in case style parameters are invalid
Troubleshooting#
Style Not Applied#
- ✅ Check parameter ID matches exactly (case-sensitive for IDs)
- ✅ Verify property name is supported for that element type
- ✅ Include units for sizes such as
borderRadiusandletterSpacing(e.g.,"8px"). A bare number for a textfontSizeis read as pixels - ✅ Send a test render with only that style parameter to isolate the issue
Font Not Loading#
- ✅ Check the name matches a Google Font or a font uploaded to your workspace
- ✅ Write the key as
fontFamily(e.g.,title.fontFamily), in this exact case - ✅ Check spelling and capitalization
- ✅ Ensure font supports your required weights
- ✅ Test with common fonts first (e.g., "Roboto", "Open Sans")
Multi-Page Issues#
- ✅ Use correct page prefix (e.g.,
page1@,page2@) - ✅ Verify parameter exists on that specific page
- ✅ Check page number is correct (1-based indexing)
Ready to automate?
Start rendering images, PDFs and videos from your templates in under 2 minutes. Free plan, no credit card.
Get your API key- Image, PDF and video generation via API
- Visual editor with AI and smart layouts
- Zapier, Make, MCP and 40+ integrations
- White-label embed for your own app
- 100 free credits a month, no credit card required