Skip to main content
The Corti Dictation Web Component provides various CSS variables for customization. You can override these variables to match your design system.

Overriding Dark/Light Theme

By default, the UI uses the system color-scheme (dark or light). This may not suit your application though, so you can force either dark or light using the color-scheme CSS property. For example, the styles below will force light mode.

Direct CSS Properties

Some CSS properties can be set directly on the corti-dictation component and will affect the component’s :host element, similar to how color-scheme works. These include inherited properties that affect the host:
Note: While these properties can be set directly, the component primarily uses CSS custom properties (documented below) for styling, which provides more control and is the recommended approach.

Using CSS Variables

For more control in customization of the UI component, you can redefine the variables inside a global CSS file or within a <style> tag. Note, the following CSS variables may change over time.

Available Styling Variables

Component Defaults

Card Styling

Action Buttons

Customizing with Shadow DOM

Important: Due to Shadow DOM encapsulation, you cannot use CSS selectors like corti-dictation button from outside the component. Shadow DOM prevents external styles from penetrating into the component’s internal structure. The component does not expose CSS parts (part attributes), so ::part() selectors are not available. If you need to style internal elements beyond what CSS custom properties allow, you must access the Shadow DOM directly. Element IDs and internal structure can change at any time though, so you should only consider this in very specific situations. If you need to access nested elements, you’ll need to traverse multiple shadow roots:
Note: This approach is fragile and not recommended. Element IDs and internal structure are implementation details that may change between versions.

Using Individual Components

If you use the individual Dictation components (like dictation-recording-button, dictation-settings-menu, dictation-device-selector, dictation-language-selector) directly instead of the corti-dictation wrapper, you can still set CSS properties directly on them (similar to color-scheme), and use CSS custom properties. However, you cannot use CSS selectors like dictation-recording-button button because these components also use Shadow DOM.
For further customization, consider using the component’s events and JavaScript APIs to build your own UI, or use the CSS custom properties documented above.

See also