Toggle On
A large switch flips on, the stage lights up, and a feature label and its state write in. A free, MIT-licensed Remotion UI block.
$ pnpm dlx shadcn@latest add @remocn/toggle-onUsage
// src/Root.tsx
import { Composition } from "remotion";
import { ToggleOn } from "@/components/remocn/toggle-on";
const ToggleOnScene = () => (
<ToggleOn
label="Auto-captions"
state="On"
/>
);
export const RemotionRoot = () => (
<Composition
id="ToggleOn"
component={ToggleOnScene}
durationInFrames={210}
fps={60}
width={1280}
height={720}
/>
);A big switch presses and flips on, the surrounding stage brightens, and the label and state words write in beside it. Pass your own label and state text; it ships light and dark through theme.
The ground is a live gradients.sh shader (GshGround), installed with the component as @remocn/gsh. Pick another look with the ground preset prop.
Props14
| Prop | Type | Default |
|---|---|---|
| label | string"Auto-captions" Feature name written in beside the switch. | |
| state | string"On" State word written in after the label, such as On. | |
| fontWeight | number400 Weight of the label and state. | |
| stagger | number8 Frames between the label and the state word. | |
| fontFamily | string"Space Grotesk" Typeface for the copy. Load the font in your project first. | |
| accent | string"#3B5BFD" Color of the switch track when on. | |
| ink | string— Text color; overrides the theme ink. | |
| background | string— Solid fill in place of the gradient ground; pass "transparent" to drop it. | |
| theme | "dark" | "light""dark" Color scheme. Ships light and dark. | |
| ground | GshPresetId— Shader preset id for the animated background. | |
| groundParams | Partial<GradientParams>— Partial shader parameters that override the ground preset. | |
| scale | number1 Size of the foreground around the frame's center; the background stays put. | |
| delay | number0 Frames to hold the first frame before anything moves. | |
| speed | number1 Playback speed multiplier for the whole timeline. | |
- labelstring
Feature name written in beside the switch.
Default
"Auto-captions" - statestring
State word written in after the label, such as On.
Default
"On" - fontWeightnumber
Weight of the label and state.
Default
400 - staggernumber
Frames between the label and the state word.
Default
8 - fontFamilystring
Typeface for the copy. Load the font in your project first.
Default
"Space Grotesk" - accentstring
Color of the switch track when on.
Default
"#3B5BFD" - inkstring
Text color; overrides the theme ink.
- backgroundstring
Solid fill in place of the gradient ground; pass "transparent" to drop it.
- theme"dark" | "light"
Color scheme. Ships light and dark.
Default
"dark" - groundGshPresetId
Shader preset id for the animated background.
- groundParamsPartial<GradientParams>
Partial shader parameters that override the ground preset.
- scalenumber
Size of the foreground around the frame's center; the background stays put.
Default
1 - delaynumber
Frames to hold the first frame before anything moves.
Default
0 - speednumber
Playback speed multiplier for the whole timeline.
Default
1