Skip to content

How to Add a Theme Toggle to Your Framer Website

Framer has built-in support for dark and light modes, but it doesn’t include a native toggle component to switch between them — either in the canvas or on published websites.

That’s exactly why I created the Framer theme toggle component — a fully native Framer component that gives your visitors the freedom to choose their preferred theme. Whether they follow system settings or want to override them (e.g., dark system + light website), this toggle works instantly.


🔧 How the Framer Theme Toggle Works

Under the hood, this component relies on Color Styles defined in the Assets panel. These styles must have both light and dark versions so the toggle can switch between them.


🎨 Step 1: Define Your Color Styles in Framer

Here’s how to create dynamic color styles that respond to theme changes:

  1. Open the Assets panel in Framer.
  2. Click the “+” button and select Color → New Style.
  3. Use the sun icon ☀️ to set the light theme color.
  4. Use the moon icon 🌙 to define the dark theme color.
color styles panel image

Pro Tip: Only colors defined as Color Styles will respond to theme changes. Do not use static hex values.


🧱 Step 2: Apply Color Styles to Your Layers

To make your design responsive:


⬇️ Step 3: Add the Theme Toggle Component to the Canvas

Drag or paste the Framer theme toggle component into your canvas. It will immediately enable theme switching across your entire site.


🛠 Step 4: Customize the Framer theme toggle component Properties

You’ll find a wide range of visual controls to match your site’s look and feel.

all settings available from the framer theme toggle component

🔘 Switch vs Button Mode

Choose the toggle style:

set the width and height for framer theme toggle component

🌟 Icon Size

Use the slider or input field to control the icon size independently of the component.


🎨 Background, Border, Radius, and Padding


🖼 Icon Styling

Customize:

Always use color styles to allow theme switching.


🎬 Transitions

Control animation:

Make your toggle feel smooth and delightful.

transition settings for framer theme toggle component transition overview for framer theme toggle component

✅ Recap

With Framer theme toggle component, you get:

Just follow these 4 steps:

  1. Define color styles
  2. Apply to all layers
  3. Add component
  4. Customize appearance

🧠 Local Theme Memory

The Framer theme toggle component stores the visitor’s theme preference using localStorage — so they return to the same mode they chose last time.


🎥 Watch the Tutorial

Want a visual walk-through?

👉 Watch the YouTube tutorial


💬 Final Thoughts

The Framer theme toggle component is a must-have for any Framer designer or developer creating multi-theme experiences. It’s responsive, intuitive, and saves time. I hope it delivers great value — and becomes part of your core Framer toolkit.