Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Info Button

The lens-info-button component displays a tooltip-style popup that provides users with helpful information or guidance. The popup is toggled by clicking the button.

This component is commonly used across various other components in Lens.

Props

PropTypeDefaultDescription
messagestring or string[]""Text to display inside the tooltip. If an array is passed, each string will be rendered on a new line.
buttonSizestring"16px"Sets both the width and height of the button (e.g., "24px").
alignDialogue"left" | "right" | "center""center"Controls where the tooltip appears relative to the button.
dialogueMaxWidthstring"300px"Maximum width of the tooltip container.
inSearchBarbooleanfalseApplies special styling when used inside a search bar (e.g., white icon with orange hover).

Usage

Here's a basic example of how to use the <lens-info-button> component:

<lens-info-button message="This will inform the user about the app!">
</lens-info-button>

Or with multiple lines:

<lens-info-button
    message='["Line one", "Line two", "Line three"]'
    buttonSize="20px"
    alignDialogue="right"
    dialogueMaxWidth="250px"
>
</lens-info-button>

Styling

Part nameDescription
lens-info-buttonStyles the button container.
lens-info-button-iconDefault icon styling.
lens-info-button-icon-in-search-barStyling override when inSearchBar is true.
lens-info-button-dialogueTooltip wrapper.
lens-info-button-dialogue-messageIndividual message lines.
lens-info-button-dialogue-align-centerTooltip center alignment.
lens-info-button-dialogue-align-leftTooltip left alignment.
lens-info-button-dialogue-align-rightTooltip right alignment.

Exmaple

lens-info-button::part(lens-info-button-icon) {
    color: var(--primary-color);
}