AI Copilots - Styling and customization
Styling default components is enabled through a range of means, such as CSS variables, class names, and more. It’s also possible to use overrides to modify any strings used in the default components, which is especially helpful for localization.
Default components
To add the default components’ theme, import the default styles CSS file.
You can also import one of two CSS files to enable dark mode, depending on how you’d like to enable it.
CSS variables
A number of CSS variables can be used to customize colors, spacing, and more. This is our recommended path for styling the default components, as you can quickly and easily modify all components with just a few variables.
Class names
Should you need deeper customization, class names can be styled, some of which provide contextual data attributes.
Overrides and localization
It’s possible to override strings used in the default components, which has a couple of different uses, the first being localization. In this example, we’re globally setting the AI composer’s placeholder from “Ask anything…” to “Posez une question” for French users.
You can also override strings on a component basis, for example if you’d like to change the “Send” button tooltip to “Post message” in the chat’s message composer.