How to Make a Website Dark Mode

July 23, 2026

Jotform takes the hassle out of adding dark mode to your website with the Dark Mode widget. Give visitors the option to switch between light and dark themes, making your website more comfortable to browse in different lighting conditions.

Whether you’re creating a blog, portfolio, online store, or business website, the Dark Mode widget helps visitors choose the viewing mode that works best for them while creating a more enjoyable browsing experience.


Adding the Dark Mode toggle feature to your website only takes a few steps. Here’s how to set it up:

  1. On the top-left side of your Workspace page, click on Create.
Jotform Workspace with the Create button highlighted in the top-left corner, used to create a new website widget
  1. Then, in the menu that opens up, select Website Widget.
Jotform Create menu displaying the Website Widget option for creating a new website widget
  1. Next, in the Search bar in the upper-left corner of Choose Website Widget, enter Dark Mode.
  2. Now, in the search results, click on Use Widget.
Jotform Choose Website Widget window with Dark Mode entered in the search bar and the Use Widget button visible on the Dark Mode widget card in the search results
  1. Now, in the Widget Properties menu that opens on the right side of Website Widgets, under the General tab, click on and hold the slider handle, then drag it to adjust the transition speed between light and dark mode.
Jotform Website Widget Builder displaying the Widget Properties panel under the General tab with the Transition Speed slider highlighted for adjusting the transition speed between light and dark mode
  1. Next, under the Style tab, customize these properties:
    • Theme preset — Select a predefined dark color theme from the Dropdown menu.
    • Corner radius — Select one of the following options to choose the corner style of the dark mode button:
      • Square — Displays the button with square corners.
      • Rounded — Displays the button with rounded corners.
      • Circular — Displays the button with fully rounded corners.
    • Button Size — Click on and hold the slider handle, then drag it to adjust the width and height of the dark mode button.
    • Custom CSS — Enter custom CSS to further customize the widget’s appearance.
Jotform Website Widget Builder displaying the Widget Properties panel under the Style tab with Theme Preset dropdown, Corner Radius options, Button Size slider, and Custom CSS field for customizing the Dark Mode widget
  1. Next, under the Layout tab, configure these options:
    • Button Behavior — Select Fixed to keep the dark mode button in a fixed position on the page, or select Inline to display it within your page content.
    • Button Position — Select where you want the dark mode button to appear on the page.
  2. Once everything’s set, in the pink navigation bar at the top of the page, click on Publish.
Jotform Website Widget Builder displaying the Widget Properties panel under the Layout tab with Button Behavior and Button Position options, and the Publish button visible in the pink navigation bar at the top of the page

Note

If you’re not logged in, you’ll be asked to log in to your Jotform account or sign up for one. Once you’ve done that, you’ll be able to get the embed code for your widget.

  1. Then, in the Embed section, click on Copy Code, and, if you already know how, paste that into the Embed section on your platform, and you’re good to go.
Jotform Embed section displaying the Copy Code button for copying the published Dark Mode widget embed code
  1. To view embedding instructions for your widget, click on Platforms in the menu on the left side of the page.
  2. Next, in the Platforms section on the right, select the platform you want to view embedding instructions for. Or, use the Search bar at the top of the section to find it easily.
Jotform Embed page displaying the Platforms menu on the left and a list of supported website platforms on the right, with a Search bar for finding platform-specific embedding instructions for the Dark Mode widget
  1. Then, follow the steps in the How to Embed Your Widget section to add it to your website.
Jotform Embed page displaying the How to Embed Your Widget section with instructions for adding the Dark Mode widget to a supported website platform

That’s it! Your Dark Mode widget will appear on your website based on how you set it up. The screenshot below shows how it looks on a website.

Embedded Dark Mode widget displayed on a website, showing the configured dark mode toggle button with the selected theme, corner style, size, and position

Note

You can manage the website widgets you’ve created at any time from your account. For a full breakdown of how to do it, head over to our guide on How to Manage Website Widgets.

Send Comment:

Jotform Avatar
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Podo Comment Be the first to comment.
Still have unanswered questions?

We’re here for you 24/7, anytime you need us day or night. Have a question or need a hand with something? Our team is always ready to help out.