<Solid>v4.0.464
Renders a solid-color rectangle on a <canvas> element.
MyComp.tsximport {AbsoluteFill ,Solid } from 'remotion'; export constMyComp :React .FC = () => { return ( <AbsoluteFill > <Solid color ="#3344ff"width ={1920}height ={1080} /> </AbsoluteFill > ); };
API
width
Logical width of the canvas in pixels. Must be a positive integer.
height
Logical height of the canvas in pixels. Must be a positive integer.
effects?v4.0.464
Apply effects after the rectangle has been painted to the canvas.
color?
Fill color of the rectangle.
If omitted, it is transparent.
pixelDensity?v4.0.472
number
Controls the backing bitmap density. Default: 1.
Set a higher value to paint to a higher-resolution backing canvas while keeping the logical canvas size unchanged.
This is useful to counteract quality loss when the <Solid> is scaled up – for example via the scale render option, or on a high-DPI display in the preview. Pass usePixelDensity() to use the render scale while rendering and window.devicePixelRatio while previewing:
MyComp.tsximport {AbsoluteFill ,Solid ,usePixelDensity } from 'remotion'; export constMyComp :React .FC = () => { constpixelDensity =usePixelDensity (); return ( <AbsoluteFill > <Solid color ="#3344ff"width ={1920}height ={1080}pixelDensity ={pixelDensity } /> </AbsoluteFill > ); };
className?
A class name to apply to the <canvas> element.
style?
Inline styles to apply to the <canvas> element.
Inherited props
<Solid> inherits from, durationInFrames, name, showInTimeline and hidden from <Sequence>.
Adding a ref
You can add a React ref to a <Solid> component.
If you use TypeScript, type it with HTMLCanvasElement:
MyComp.tsximport {useRef } from 'react'; import {Solid } from 'remotion'; constMyComp = () => { constref =useRef <HTMLCanvasElement >(null); return <Solid ref ={ref }color ="red"width ={100}height ={100} />; };
What is this component for?
This is mainly a component for adding effects to a solid color.
Compatibility
| Browsers | Environments | |||||
|---|---|---|---|---|---|---|
Chrome | Firefox | Safari | ||||