// preview in
saved for every page

Toggletip

A small button that shows a short explanation when clicked. Use it next to a label, a table header or a setting whose meaning isn't obvious; it works with touch, keyboard and screen readers.

Built on Base UIPattern Button + non-modal regionClient componentSource ↗
minimal · light · #3fa34d
Total cost (APR)
align
hideArrow

Installation

Set up Camaleo once (Installation), then import what you need. It renders on the client.

import { Toggletip, ToggletipTrigger, ToggletipContent, ToggletipTitle, ToggletipDescription, ToggletipClose } from "@camaleo/react";

Anatomy

The trigger is a round button (toggletip-trigger). The tip renders in a portal, wrapped in a scope that keeps the skin, mode and brand of the page around the button.

Examples

Every example is a real file you can copy. They all wear the skin, mode and brand from the bar above. Click a "?" button, or Tab to it and press Enter.

Which one? A Tooltip names a control in a few words, on hover. A HoverCard previews where a link goes, on hover. A Toggletip explains a term on click, so it is the one that works on touch and that screen readers read.

minimal · light · #3fa34d
Security code

Next to a field label

Put the button after the label, not inside it, so the field's name stays "Billing email" and the help is one click away.

MonthChurn
August 20262.4%
September 20261.9%

In a table header

Explain how a metric is calculated without a footnote. align="end" keeps the tip inside a right-aligned column.

In a settings row

Say what a switch really does, with the date or the amount, before people turn it on.

Interest rate
Total cost (APR)

Named after the topic

Each button says "More about …" and the topic. In a screen reader's list of buttons, five plain "Info" buttons are impossible to tell apart.

IOF tax

With a link inside

Open it with the keyboard: focus goes to the tip and Tab reaches the link, so it works without a mouse. One link at most, to the full explanation.

Night-time limit

Title and close button

Click it. The title names the tip for screen readers, and ToggletipClose gives touch users a clear way out. Pass a translated aria-label.

PixWireBank slip

Alignment

align lines the tip up with the start, center or end of the button. side picks the side it opens on; it flips when there is no room.

In context

Toggletips explain terms right where people meet them. These are whole pieces of UI you can copy, in the skin you picked.

FeatureBasicPro
Team seats315
Pix transfers a month300Unlimited
API access—Included
Plan comparisonTable · Toggletip

Simulate a loan

Loan simulatorCard · Field · Input · Button · Toggletip

Security

Security settingsCard · Switch · Label · Toggletip

Guidelines

Interest rate
DoA toggletip for explanations.

It opens on a click or a tap, so phones, keyboards and screen readers all get the text.

Interest rate
Don’tA tooltip for explanations.

It needs hover or focus, so it never opens on a phone, and screen readers skip it.

Security code
DoOne or two sentences.

Enough to understand the term and carry on filling the form.

Cancellation
Don’tA whole policy in a tip.

Three paragraphs don't fit a small box. Write it on the page, or link to a help article.

Props

PropTypeDefaultDescription
sideOffsetnumber8Gap in pixels between the button and the tip.
align"center" | "end" | "start""center"Alignment of the tip along the button's edge.
side"bottom" | "left" | "right" | "top""bottom"Which side of the trigger it opens on. It flips to the other side when there is no room.
hideArrowbooleanfalseHides the arrow that points at the button.

Toggletip takes open, onOpenChange and defaultOpen. ToggletipTrigger needs an aria-label such as "More about the interest rate". ToggletipClose takes aria-label (default "Close tip"; translate it).

Styling hooks

Restyle it without forking: target the attributes, or set the tokens on a parent, a skin or the tip itself.

Attributes

data-popup-openon the trigger while the tip is open
data-sidebottom · top
data-alignstart · center · end

Tokens it reads

Color

--cml-border-control--cml-fg--cml-fg-secondary--cml-focus-ring--cml-popover-bg--cml-popover-border--cml-shadow-popover--cml-surface-raised--cml-surface-subtle

Shape & size

--cml-border-width--cml-popover-border-width--cml-radius-control--cml-radius-popover

Type & motion

--cml-font-body

This component only

--cml-toggletip-radius--cml-toggletip-trigger-border--cml-toggletip-width

Accessibility

EnterOn the button, opens the tip and moves focus to the tip itself, so its text is read first. Tab then reaches a link or close button inside.
SpaceSame as Enter.
TabInside the tip, moves to its next link or button. Past the last one, focus goes on to what follows the button and the tip closes.
EscapeCloses the tip and returns focus to the button.
Was this page helpful? · Edit this page on GitHub