A teaching bubble (TeachingBubble
) brings attention to a new or important feature, with the goal of increasing engagement with the feature. A teaching bubble typically follows a coach mark.
Use teaching bubbles sparingly. Consider how frequently people will see it, and how many they’ll see across their entire experience.
For more details and examples visit the official docs. The R package can not handle each and every case, so for advanced use cases you need to work using the original docs to achieve the desired result.
TeachingBubble(...)
TeachingBubbleContent(...)
string
Defines the element id referencing the element containing the description for the TeachingBubble.
string
Defines the element id referencing the element containing label text for TeachingBubble.
ICalloutProps
Properties to pass through for Callout, reference detail properties in ICalloutProps
IRefObject<ITeachingBubble>
Optional callback to access the ITeachingBubble interface. Use this instead of ref for accessing the public methods and properties of the component.
IFocusTrapZoneProps
Properties to pass through for FocusTrapZone, reference detail properties in IFocusTrapZoneProps
string | JSX.Element
Text that will be rendered in the footer of the TeachingBubble. May be rendered alongside primary and secondary buttons.
boolean
Whether the TeachingBubble renders close button in the top right corner.
boolean
boolean
A variation with smaller bold headline and no margins.
boolean
A variation with smaller bold headline and margins to the body. (hasCondensedHeadline
takes precedence if it is also set to true.)
string
A headline for the Teaching Bubble.
IImageProps
An Image for the TeachingBubble.
boolean
Whether or not the TeachingBubble is wide, with image on the left side.
(ev?: any) => void
Callback when the TeachingBubble tries to close.
IButtonProps
The Primary interaction button
IButtonProps
The Secondary interaction button
IStyleFunctionOrObject<ITeachingBubbleStyleProps, ITeachingBubbleStyles>
Call to provide customized styling that will layer on top of the variant rules.
Target
Element, MouseEvent, Point, or querySelector string that the TeachingBubble should anchor to.
HTMLElement
ITheme
Theme provided by High-Order Component.
Teaching bubbles can be used in sequence to walk people through complex, multistep interactions only. And only show one teaching bubble at a time.
A maximum of no more than 3 sequenced teaching bubbles should be used in a single experience.
Sequenced teaching bubbles should have “x of y” text to indicate progress through the sequence. For example, the first teaching bubble in a sequence might be “1 of 3”.)
Always place the primary button on the left, the secondary button just to the right of it.
Show only one primary button that inherits theme color at rest state. In the event there are more than two buttons with equal priority, all buttons should have neutral backgrounds.
A teaching bubble should include:
You have 25 characters (including spaces) to draw people in and get them interested. Limit to one line of text, and use sentence casing (capitalize only the first word and any proper nouns) with no punctuation.
Lead with why the feature is useful rather than describe what it is. What does it make possible? Keep it within 120 characters (including spaces).
Limit button labels to 15 characters (including spaces). Provide people with an explicit action to dismiss the teaching bubble, such as “Got it”. Include a secondary button to give people the option to take action, such as “Show me” or “Edit settings”. When two buttons are needed, make the call-to-action button the primary button and the dismissal button (such as “No thanks”) the secondary button. Use sentence casing (capitalize only the first word and any proper nouns) with no punctuation. On a sequenced teaching bubble, use "Next" for the action button label and "Got it" for the final sequenced teaching bubble action button with text that closes the experience.
library(shiny.fluent)
if (interactive()) {
shinyApp(
ui = div(
DefaultButton.shinyInput("toggleTeachingBubble", id = "target", text = "Toggle TeachingBubble"),
reactOutput("teachingBubble")
),
server = function(input, output) {
showBubble <- reactiveVal(FALSE)
observeEvent(input$toggleTeachingBubble, showBubble(!showBubble()))
output$teachingBubble <- renderReact({
if (showBubble()) {
TeachingBubble(
target = "#target",
headline = "Very useful!"
)
}
})
}
)
}