the Chromium logo

The Chromium Projects

Creating Chrome WebUI Interfaces

General guidelines

When creating or modifying WebUI resources, follow the Web Development Style Guide. Note that most WebUI code is using TypeScript, and any new additions must use TypeScript.

A general explanation of how WebUI works, including the interaction between C++ and TypeScript code, can be found in the WebUI Explainer.

Shared, cross-platform resources can be found in ui/webui/resources.

A detailed example of how to create a WebUI in can be found at Creating WebUI interfaces in chrome.

If you need additional information on how to set up the BUILD.gn file to build your WebUI, there is detailed information and additional examples for BUILD files specifically at WebUI Build Configurations.

If you need additional information on how to share TS/HTML/CSS code between multiple (2+) WebUI surfaces, see Sharing Code in WebUI.

Types of WebUI pages

Before adding a new WebUI, consider the UI's audience and purpose. If it's primarily intended for use by anyone other than Chromium developers, it is a user facing UI. If it's primarily intended for a Chromium developer team to debug code they maintain or new features the team is developing, it is a debug UI.

User facing UIs

There are a few subcategories of user facing pages:

Debug UIs

Debug UIs are primarily intended for use by Chromium developers. If a UI is expected to be frequently used by third party developers or some subset of users (e.g., enterprise admins), it's not a debug UI; see section above.

Creating a new WebUI

Apart from audience and general purpose, there are a few other questions to think about before creating any new WebUI:

You should be prepared to address these questions in code review when adding your WebUI.