Skip to the page
Docs articles

Set its look for a page

Change the widget's colors, corners, font and launcher from your snippet, move it clear of your page's own corners, and style its parts with your own CSS.

Last updated

View as Markdown
On this page

Your team picks the widget's design on the Widget page in Notert: see design your widget. Your page can then change that design for itself, with appearance in the snippet's init call or later with window.notert.appearance, and reach the widget's main parts with your own CSS. Use it when one site, or one page, needs something the team's design doesn't give it: a launcher on the left of a page whose chat button sits on the right, a darker panel on a page drawn in black, or the font your site is set in.

What works on which plan

Widget designs are on the Professional plan. On another plan the widget keeps Notert's look, and only the values that keep it out of your page's way take effect:

ValueEvery planProfessional
themeYesYes
launcherSide, launcherOffsetX, launcherOffsetY (move the launcher)YesYes
zIndex (stack it with your layers)YesYes
language (choose its language)YesYes
accent, the four palette colors, corners, edges, font, siteFont, weight, launcherShape, launcherFillNoYes
CSS partsNoYes

On another plan the design values are left unread without a warning, since the widget doesn't load the code that reads them, and the parts carry no names, so a ::part() rule matches nothing.

Set values from the snippet

appearance sits beside theme in the options init takes. This is the whole snippet, as the install guide writes it, with an appearance for a site drawn in near-black with a mint accent and square corners:

<script>
  window.$notert=window.$notert||[];window.notert=window.notert||new Proxy({},{get:(_,p)=>typeof p=="string"&&p!="then"&&/^[a-z]/i.test(p)?(...a)=>window.$notert.push([p,...a]):void 0});
  window.notert.init("YOUR_WORKSPACE_ID", {
    widget: true,
    theme: "page",
    appearance: {
      darkBackground: "#080809",
      darkText: "#efefef",
      accent: "#7ef0c4",
      corners: "none",
      edges: "border",
      launcherSide: "left",
    },
  });
</script>
<script type="module" async src="https://app.notert.io/embed/v1.js"></script>

Here Brightline's widget wears the values above on its own site: the panel opens in the bottom-left corner, square, edged with a thin line, and its keys take the mint accent. In light the keys keep the mint inside a thin darker line, since mint alone doesn't stand out on the light panel; in dark the panel takes #080809 and its text #efefef.

With the npm package, appearance is typed as NotertLook, so a misspelled key or value fails your build:

import { loadNotert, type NotertLook } from "@notert/widget";

const look: NotertLook = {
  darkBackground: "#080809",
  darkText: "#efefef",
  accent: "#7ef0c4",
  corners: "none",
  edges: "border",
  launcherSide: "left",
};

loadNotert({ workspaceId: "YOUR_WORKSPACE_ID", theme: "page", appearance: look });

Every value

KeyValuesWhat it sets
accenta six-digit hex color, such as "#7ef0c4", or "text"The main keys, the visitor's messages, links and the focus ring. "text" follows each mode's text color. With none set, the widget takes your board's color.
lightBackground, darkBackgrounda six-digit hex color, or "auto"The panel's surface in light and in dark. Its cards, borders and quiet surfaces are mixed from it and the text color.
lightText, darkTexta six-digit hex color, or "auto"The text on the panel in light and in dark. Secondary text is mixed from it and the background.
corners"none", "small", "medium", "large" or "full"How round the panel, its cards and its keys are. See corners for the sizes.
edges"shadow" or "border"A soft shadow under the panel and its cards, or a 1px line in the border color and no shadow at all.
font"inter", "system" or "site"Inter, the visitor's system font, or your page's own font named by siteFont.
siteFonta family name, such as "FunktionalGrotesk", or a CSS variable, such as "--font-geist-sans"The font for "site", as your stylesheet names it: up to 64 characters, letters in any script, digits, spaces, - and _. See your page's own font.
weight"regular" or "light""light" draws every weight one step lighter: body text at 300 rather than 400, and each heavier weight a step down with it.
launcherSide"right" or "left"Which bottom corner the launcher and the panel sit in on a wide screen.
launcherOffsetX, launcherOffsetY0 to 120, in steps of 4The distance in px from that corner's side and bottom.
launcherShape"circle", "rounded" or "square"The launcher's outline. "rounded" takes the design's corners.
launcherFill"surface" or "accent"The launcher in the panel's surface color, or filled with the accent.

Colors are written #rrggbb, in either case. Three-digit colors, color names and rgb() aren't read.

The same values on the Widget design page

Each value is one of the rows your team sets on the Widget design page, so you can try a look there, in its preview, and then write it for one page:

On the Widget design pageIn appearance
Accentaccent
Light, Background and TextlightBackground, lightText
Dark, Background and TextdarkBackground, darkText
Cornerscorners
Edgesedges
Fontfont, and siteFont for Site's
Weightweight
SidelauncherSide
ShapelauncherShape
FilllauncherFill
From sidelauncherOffsetX
From bottomlauncherOffsetY
Modenone: your page sets theme instead

Mode stays the team's. While it's Light or Dark, every visitor gets that one whatever your page says; while it's System, your page's theme decides.

How the values stack

The widget starts from the template your team picked, Classic until it picks another, puts what your team changed in Customize over it, then the appearance in your init call, then each later appearance call, in order. Each value goes over the one before it alone: a later call that sets accent leaves the corners an earlier one set. Nothing your page sets is saved, and it holds only on the page that sets it.

Colors and readability

The widget draws light or dark by your team's Mode, or by your page's theme while the mode is System, and takes the background and text for the one it draws. So on a page with theme: "page", set both palettes, or the one you leave unset keeps Notert's own.

  • A palette with neither color set keeps Notert's own. "auto" puts Notert's own back in place of one the template sets, such as Midnight's dark colors.
  • A palette with one color set gets the other picked for it: white or near-black, whichever reads better.
  • The widget keeps every color readable. Text and secondary text are moved until they read at 4.5:1 on the background. The accent, as a key's fill, keeps your color wherever its label reads on it. Where that color doesn't stand out at 3:1 from the background, as a yellow on white doesn't, the key draws a thin line around it that does. A color no label reads on is moved toward the text color until one does. As a link, the accent is moved until it reads at 4.5:1, and the visitor's own messages until their words read at 4.5:1.
  • A dark background draws the dark details. Borders, shadows and the launcher's lift follow how dark the background you set is, not which palette it's in, so a lightBackground of "#101010" draws as a dark widget.

Corners

corners sets the radius of the panel's cards and keys, in pixels so your page's root font size never changes it, and the panel itself is drawn rounder in proportion:

cornersCards and keysPanel
"none"0px0px
"small"4px10px
"medium"7.2px19px
"large"10px26px
"full"16px42px

"large" is Classic's. On a phone, where the panel fills the screen, the panel has no corners of its own.

Change it after init

window.notert.appearance takes the same values, with theme and language beside them, and applies them at once, open or shut, each call over the last:

window.notert.appearance({ theme: "dark", accent: "#7ef0c4" });

You can call it before the widget has loaded, even before init: the snippet queues the call, and the widget starts with it in place.

A key the widget doesn't know, or a value it can't use, is left out with a warning in the browser's console, such as Notert: appearance.corners was ignored., and the rest still apply.

Move the launcher, on any plan

The launcher is a round button 48px tall, 16px from the bottom-right corner of the window, until your team's design or your page moves it:

While one of your changelog updates is new to the visitor, and no reply or news waits for them, the launcher stretches from that corner to show the update's title beside a megaphone, with a green dot while someone on your team is online.

launcherSide, launcherOffsetX and launcherOffsetY work on every plan, so your page can keep the launcher clear of what it draws in that corner, such as a cookie banner or a button of its own:

window.notert.init("YOUR_WORKSPACE_ID", {
  widget: true,
  theme: "page",
  appearance: { launcherSide: "left" },
});

To lift it over a banner only while the banner shows, call appearance as the banner comes and goes. Here a consent banner 88px tall sits along the bottom of the page:

const banner = document.querySelector("#cookie-banner");

function placeLauncher() {
  // Clear of the banner while it shows, back to Classic's 16px once it's gone.
  window.notert.appearance({ launcherOffsetY: banner.hidden ? 16 : 96 });
}

placeLauncher();
new MutationObserver(placeLauncher).observe(banner, {
  attributes: true,
  attributeFilter: ["hidden"],
});

How the launcher and the panel follow these values:

  • The panel opens on the same side, at the same distance, on a wide screen, and covers the launcher while it's open.
  • On a phone the panel fills the screen, clear of the notch and the home bar, whatever the side and distances say. It does so in a window narrower than 640px, and on a touch screen shorter than 500px, such as a phone on its side.
  • The launcher keeps clear of a phone's home bar, sitting the distance you set above it rather than above the screen's edge.
  • A distance must be a multiple of 4, from 0 to 120. Any other number, such as 90, is left out with a warning, and the launcher keeps where it was.

To take the launcher off the page for a moment rather than move it, as under a full-screen video, see hideLauncher. To open the widget from a button of your own and draw no launcher at all, see your own button.

Stack it with your page's layers, on any plan

The widget draws over everything on your page, at a z-index of 2147483000 on the element it adds to the end of your <body>. Where something of yours must cover it, such as a full-screen video or a dialog of your own, set zIndex to a whole number from 0 to 2147483647, and the widget stacks at that level among your page's own:

// Below a dialog of yours drawn at z-index 1100, above your sticky header at 900.
window.notert.appearance({ zIndex: 1000 });

A value that isn't such a number, such as "1000" as a string or 10.5, is left out with a warning in the browser's console.

Your page's own font

A font your page loads is one the widget can draw in, since it lives on your page. Set font: "site" and name it in siteFont as your stylesheet's font-family does:

window.notert.appearance({ font: "site", siteFont: "FunktionalGrotesk", weight: "light" });

If your font loader renames the family on every build, as Next.js's next/font does, give the CSS variable it sets instead, and the widget draws in whatever that variable names on your page:

// app/layout.tsx: the class sets --font-geist-sans on <html>, whatever the family is named this build.
import { GeistSans } from "geist/font/sans";

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en" className={GeistSans.variable}>
      <body>{children}</body>
    </html>
  );
}
window.notert.appearance({ font: "site", siteFont: "--font-geist-sans" });

The variable a Tailwind or shadcn stylesheet names its font by, --font-sans, works the same way. The widget reads it as your <body> sees it, as it draws.

Until the font loads, and on a page that doesn't load it or set the variable, the widget draws in Inter. font: "site" with no siteFont draws in Inter too.

Style its parts with your CSS

The widget draws inside a shadow root, so your page's CSS never reaches it by accident. Its main parts carry names your CSS can aim at with ::part() on the element the widget adds to your page, [data-notert-widget]:

[data-notert-widget]::part(launcher) {
  box-shadow: none;
  outline: 1px solid #393941;
}

[data-notert-widget]::part(launcher):hover {
  outline-color: #7ef0c4;
}

[data-notert-widget]::part(bubble-visitor) {
  border-radius: 2px;
}
PartWhat it is
launcherThe round button in the corner that opens the widget.
panelThe panel that opens.
headerThe row at the top of the panel: its title, the close button and, on each tab, the bell.
bubble-visitorA message the visitor sent.
bubble-teamA message from your team, Otto or your away reply.
composerThe box the visitor writes in.
button-primaryThe main button on a screen, such as send and start a conversation.

The names stay the same from release to release. A few things follow from how ::part() works:

  • You reach the part, never what's inside it. ::part(panel) button matches nothing. To change what's inside, use the values above.
  • States work. ::part(launcher):hover, :focus-visible and :active all apply, as in the example.
  • Your rule wins over the widget's own for the property it sets, so style with care: display: none on panel hides the widget, and a rule that takes away outline on focus takes away what keyboard users see.
  • Parts are named only on the Professional plan, and launcher only while the widget wears your team's design, so on another plan these rules match nothing.

If something doesn't change

  • Open the browser's console. A value the widget can't use says so there, as Notert: appearance.<key> was ignored., and the rest of the call still applies. See troubleshooting.
  • Check the plan. On a plan without widget designs, colors, corners, fonts and parts do nothing, without a warning. Only theme, the launcher's place, zIndex and language apply.
  • Check the mode. With Mode set to Light or Dark on the Widget design page, your page's theme changes nothing, and only that palette's colors draw.
  • A color looks different from the one you wrote. The widget moved it until it reads on its background; see colors and readability.
  • The panel ignores the side on a phone. In a window narrower than 640px the panel fills the screen, wherever the launcher sits.

Start here

Up and down arrowsto moveEnterto openEscto close