Skip to main content

Styling

The Website Widget allows for extensive customization of its appearance through data- attributes in the script tag. These attributes support global theme configurations as well as specific styling parameters for individual components.

Global theme configuration

The following attributes set global styles that apply across all components.

ParameterDescriptionDefault Value
data-project-colorDefines the primary color for the widget, applied to elements such as buttons, links, and active states. You should set this to your brand's color."#718096"
data-font-familySets the font family for all text elements."-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji"
data-font-size-xsDefines font size for extra-small text elements."0.75rem"
data-font-size-smDefines font size for small text elements."0.875rem"
data-font-size-mdDefines font size for medium text elements."1rem"
data-font-size-lgDefines font size for large text elements."1.125rem"
data-font-size-xlDefines font size for extra-large text elements."1.25rem"
data-scale-factorAdjusts the scale of all widget elements (font sizes, gaps, paddings, margins). Useful when your site has a non-standard base font size."1"
data-hyperlink-colorOverrides the color of link text in the answer.Default is the project color.
data-text-colorOverrides the global text color used across the widget components."inherit"

View mode presets

The data-view-mode attribute lets you switch between built-in layout presets. A preset applies a coordinated set of default styles across multiple components, giving you a complete layout with a single attribute. You can still override any individual component style on top of a preset — user-specified data-* attributes always take precedence over preset defaults.

ParameterDescriptionDefault Value
data-view-modeThe layout preset to use. Available values: "default", "sidebar"."default"

Renders the widget as a persistent right sidebar taking up the full viewport height with a fixed width. This is useful for documentation or support sites where you want the AI assistant to always be visible. See the sidebar style example for a full walkthrough.

The sidebar preset applies the following defaults:

ComponentPropertyPreset Value
Modalsize"500px"
Modallock-scroll"false"
Modalx-offset"0"
Modaly-offset"0"
Modalfull-screen-on-mobile"true"
Modaltransition"slide-left" (300ms)
Modal Overlayhidden"true"
Modal Innerjustify-content"flex-end"
Modal Innerright"4px"
Modal Innerbottom"4px"
Modal Innertop"4px"
Modal Contentborder-radius"var(--mantine-radius-md)"
Modal Headerbackground-color"#fff"
Example Questionscol-span"12"
<script
...
data-view-mode="sidebar"
data-modal-open-by-default="true"
data-launcher-button-hidden="true"
></script>

Component style configuration

The Website Widget supports flexible styling for its components using data- attributes. Each component has a unique attribute name (e.g., modal-header), and you can apply a range of CSS properties to customize its appearance. The component style configurations override any global theme configurations.

Supported CSS properties

The following CSS properties can be applied to all components. The default values for these properties depend on the specific component. All of these properties are optional.

ParameterDescription
background-colorDefines background color
borderDefines border style
border-bottomDefines bottom border
border-colorDefines border color
border-radiusDefines border radius
colorDefines text color
font-familyDefines font family
font-sizeDefines font size
font-weightDefines font weight
opacityDefines opacity
heightDefines height
widthDefines width
max-heightDefines maximum height
max-widthDefines maximum width
min-heightDefines minimum height
min-widthDefines minimum width
paddingDefines padding
padding-topDefines top padding
padding-bottomDefines bottom padding
padding-leftDefines left padding
padding-rightDefines right padding
padding-xDefines horizontal padding
padding-yDefines vertical padding
margin-topDefines top margin
margin-bottomDefines bottom margin
margin-leftDefines left margin
margin-rightDefines right margin
margin-xDefines horizontal margin
margin-yDefines vertical margin
flex-directionDefines flex direction
justify-contentDefines flex justify
topDefines top position
leftDefines left position
rightDefines right position
bottomDefines bottom position
box-shadowDefines box shadow
text-shadowDefines text shadow
z-indexDefines z-index

Pseudo-state variants

Any supported CSS property can also target a pseudo-state by adding a state prefix between the component attribute name and the property suffix. The format is data-{component}-{state}-{property}.

PrefixCSS Pseudo-stateExample
hover-:hoverdata-launcher-button-hover-background-color
focus-:focusdata-query-input-focus-border-color
placeholder-::placeholderdata-query-input-placeholder-color
active-:activedata-submit-button-active-background-color

Available components

The following components of the Website Widget can be customized with the Supported CSS Properties. Some components support additional individual configuration options. Some components inherit configured parameters from each other.

NameAttribute NameInherits FromDescription
Launcher Buttonlauncher-buttonThe floating button that opens the widget modal.
Launcher Button Labellauncher-button-labelThe text label on the launcher button.
ModalmodalThe main modal dialog container.
Modal Innermodal-innerThe inner wrapper of the modal controlling layout and positioning.
Modal Contentmodal-contentThe content area of the modal.
Modal Overlaymodal-overlayThe overlay/backdrop behind the modal.
Modal Headermodal-headerThe header section of the modal.
Modal Logomodal-logoThe logo image in the modal header.
Modal Titlemodal-titleThe title text in the modal header.
Modal Close Buttonmodal-close-buttonThe close button in the modal header.
Modal Bodymodal-bodyThe body section of the modal.
Modal Footermodal-footerThe footer section of the modal.
DisclaimerdisclaimerThe disclaimer text shown at the top of the conversation.
Chat Disclaimerchat-disclaimerA disclaimer text shown in the chat area.
Consent Screenconsent-screenThe consent screen shown before the user can interact with the widget.
Query Inputquery-inputShared base styles for both the Ask AI and Search input fields.
Ask AI Inputask-ai-inputQuery InputThe input field for asking AI questions.
Search Inputsearch-inputQuery InputThe input field for search queries.
Submit Buttonsubmit-buttonThe button used to submit a question.
Example Questionsexample-questionsThe container for example question buttons.
Example Question Buttonexample-question-buttonAn individual example question button.
Conversation Item Questionconversation-item-questionThe user's question bubble in the conversation.
Conversation Item Answerconversation-item-answerThe AI's answer bubble in the conversation.
Conversation Buttonconversation-buttonShared base styles for conversation action buttons.
Answer Feedback Buttonanswer-feedback-buttonConversation ButtonThe thumbs up/down feedback buttons.
Answer Copy Buttonanswer-copy-buttonConversation ButtonThe button to copy an answer.
Thread Clear Buttonthread-clear-buttonConversation ButtonThe button to clear the conversation thread.
Deep Thinking Buttondeep-thinking-buttonConversation ButtonThe button to toggle deep thinking mode.
Answer CTA Buttonanswer-cta-buttonA custom call-to-action button below the answer.
Source Linksource-linkA source reference link shown below the answer.
Source Link Primary Headingsource-link-primary-headingThe primary heading text of a source link.
Source Link Secondary Headingsource-link-secondary-headingThe secondary heading text of a source link.
Search Resultsearch-resultAn individual search result item.
Search Result Badgesearch-result-badgeThe source badge on a search result.
Search Result Primary Textsearch-result-primary-textThe primary text of a search result.
Search Result Secondary Textsearch-result-secondary-textThe secondary text of a search result.
Search Ask AI CTAsearch-ask-ai-ctaThe "Ask AI" call-to-action shown in search results.
SwitchswitchThe toggle switch between Ask AI and Search modes.
Switch Labelswitch-labelThe label text on the mode switch.
MCP Buttonmcp-buttonThe MCP install button in the modal header.
MCP Dropdownmcp-dropdownThe MCP install dropdown menu.
Kapa Brandingkapa-brandingThe "Powered by Kapa" branding element.
Privacy Linksprivacy-linksThe privacy policy links section.

Style inheritance

Some components inherit styles from a parent component. Styles set on the parent apply to all inheriting children, but can be overridden by setting attributes on the child component specifically.

Parent ComponentChild Components
Query InputAsk AI Input, Search Input
Conversation ButtonAnswer Feedback Button, Answer Copy Button, Thread Clear Button, Deep Thinking Button

For example, styles set on data-query-input-* apply to both the Ask AI and Search inputs, but can be overridden by setting data-ask-ai-input-* or data-search-input-* specifically.

Variant styles

The Answer Feedback Button and Deep Thinking Button support two visual states: a base state and an enabled state. The enabled state is styled using a separate attribute name. All supported CSS properties can be applied to either state independently.

ComponentBase Attribute NameEnabled Attribute Name
Answer Feedback Buttonanswer-feedback-buttonanswer-feedback-button-enabled
Deep Thinking Buttondeep-thinking-buttondeep-thinking-button-enabled

Applying styles to components

To style a component, concatenate the data- prefix with the component's attribute name (e.g., modal-header) and the CSS property name. This forms the complete data- attribute for the component.

Example: styling the modal header

<script
...
data-modal-header-background-color="#1a1a2e"
data-modal-header-color="#ffffff"
data-modal-header-padding-y="12px"
></script>

Example: styling with hover and focus states

<script
...
data-query-input-placeholder-color="#999"
data-query-input-focus-border-color="#6306B6"
data-launcher-button-hover-background-color="#5205a0"
></script>

Example: styling the variant components

<script
...
data-answer-feedback-button-border="1px solid #dee2e6"
data-answer-feedback-button-border-radius="4px"
data-answer-feedback-button-enabled-background-color="#e8f5e9"
data-answer-feedback-button-enabled-border="1px solid #4caf50"
data-deep-thinking-button-enabled-background-color="#e3f2fd"
data-deep-thinking-button-enabled-color="#1976d2"
></script>

Component-specific configuration options

Some components support additional individual configuration options beyond the universal CSS properties listed above. These are listed below for each component.

Launcher button

ParameterDescriptionDefault Value
data-launcher-button-hiddenSet to "true" to hide the launcher button."false"
data-launcher-button-imageURL for the image displayed on the button.[project-logo]
data-launcher-button-textText displayed on the button."Ask AI"
data-launcher-button-image-heightHeight of the button image in pixels."32"
data-launcher-button-image-widthWidth of the button image in pixels."32"
data-launcher-button-animation-enabledSet to "false" to disable the button entrance animation."true"
data-launcher-button-hover-animation-enabledSet to "false" to disable the button hover animation."true"
ParameterDescriptionDefault Value
data-modal-sizeWidth of the modal."800px"
data-modal-lock-scrollSet to "false" to allow page scrolling when the modal is open."true"
data-modal-x-offsetHorizontal offset of the modal."0vw"
data-modal-y-offsetVertical offset of the modal."6vh"
data-modal-full-screenSet to "true" for full screen modal."false"
data-modal-full-screen-on-mobileSet to "false" to disable full screen on mobile."true"
data-modal-z-indexZ-index of the modal."200"
ParameterDescriptionDefault Value
data-modal-overlay-hiddenSet to "true" to hide the modal overlay."false"
ParameterDescriptionDefault Value
data-modal-logo-hiddenSet to "true" to hide the modal logo."false"
data-modal-logo-hidden-on-mobileSet to "true" to hide the logo on mobile devices."false"
data-modal-logo-srcURL for the logo image.[project-logo]
data-modal-logo-src-ask-aiURL for the logo when in Ask AI mode.Value of src
data-modal-logo-src-searchURL for the logo when in Search mode.Value of src
ParameterDescriptionDefault Value
data-modal-title-textThe title text."[project name] Docs AI"
data-modal-title-text-ask-aiThe title text when in Ask AI mode.Value of text
data-modal-title-text-searchThe title text when in Search mode.Value of text
ParameterDescriptionDefault Value
data-modal-close-button-hiddenSet to "true" to hide the close button."false"
ParameterDescriptionDefault Value
data-modal-footer-textCustom text for the footer.Not set

Chat disclaimer

ParameterDescriptionDefault Value
data-chat-disclaimerThe disclaimer text content. Supports Markdown.""
ParameterDescriptionDefault Value
data-consent-screen-titleTitle text for the consent screen."Hi there, do you want to use the AI chat?"
data-consent-screen-disclaimerDisclaimer text for the consent screen.(i18n default)
data-consent-screen-accept-button-textText for the accept button."I agree, lets chat!"
data-consent-screen-reject-button-textText for the reject button."No, not interested"

Ask AI input

ParameterDescriptionDefault Value
data-ask-ai-input-placeholderPlaceholder text for the input field."Ask me a question about [project name]..."

Search input

ParameterDescriptionDefault Value
data-search-input-placeholderPlaceholder text for the search input."Search sources..."
data-search-input-icon-hiddenSet to "true" to hide the search icon."false"

Example questions

ParameterDescriptionDefault Value
data-example-questionsComma-separated list of example questions.Not set
data-example-questions-col-spanGrid column span for each example question button ("6" = 2 cols)."6"

Conversation button

ParameterDescriptionDefault Value
data-conversation-button-label-hiddenSet to "true" to show only icons (hide text labels)."false"
data-conversation-button-icon-sizeSize of the icon in conversation buttons."1rem"

Answer feedback button

ParameterDescriptionDefault Value
data-answer-feedback-button-icon-sizeSize of the feedback button icon.Not set

Answer copy button

ParameterDescriptionDefault Value
data-answer-copy-button-icon-sizeSize of the copy button icon.Not set

Thread clear button

ParameterDescriptionDefault Value
data-thread-clear-button-icon-sizeSize of the clear button icon.Not set

Deep thinking button

ParameterDescriptionDefault Value
data-deep-thinking-button-icon-sizeSize of the deep thinking button icon."1rem"

Answer CTA button

ParameterDescriptionDefault Value
data-answer-cta-button-enabledSet to "true" to enable the CTA button."false"
data-answer-cta-button-textText displayed on the CTA button."Talk to an Expert"
data-answer-cta-button-linkURL the CTA button links to."#"

Search result

ParameterDescriptionDefault Value
data-search-result-targetThe link target for search results."_blank"

Search ask AI CTA

ParameterDescriptionDefault Value
data-search-ask-ai-cta-hiddenSet to "true" to hide the Ask AI CTA in search."false"

Switch

ParameterDescriptionDefault Value
data-switch-icon-hiddenSet to "false" to show icons on the switch."true"

MCP button

ParameterDescriptionDefault Value
data-mcp-button-hiddenSet to "true" to hide the MCP button."true"
data-mcp-button-textText displayed on the MCP button."Use MCP"

MCP dropdown

ParameterDescriptionDefault Value
data-mcp-dropdown-descriptionDescription text in the MCP dropdown.(i18n default)

Kapa branding

ParameterDescriptionDefault Value
data-kapa-branding-hiddenSet to "true" to hide the Kapa branding."false"
data-kapa-branding-textCustom text for the branding.Not set
ParameterDescriptionDefault Value
data-privacy-links-linksJSON array of link objects, each with title and url fields. Example: '[{"title":"Privacy","url":"/privacy"}]'.[]

Deprecated attributes

The legacy flat-style attributes (e.g., data-button-bg-color, data-modal-header-bg-color) are still supported for backward compatibility but are superseded by the new component-based system described above. When both a legacy attribute and a new component-based attribute are set, the new component-based attribute takes precedence.

For the full list of legacy attributes, see the Legacy Configuration page.