Callout

Display custom, absolutely positioned info using a callout.

Examples

Contents

UsageAPIs

Usage

Before using a callout, consider using a tooltip, dialog, or panel. If none of these fit your needs, use a callout directly.

APIs

ContentJustification

Start0
number
Center1
number
End2
number
Stretch3
number

ContentLocation

Start0
number
Center1
number
End2
number

ContentOrientation

Column0
number
Row1
number

ContentSize

Small0
number
Medium1
number
Large2
number
Auto3
number
ExtraLarge4
number

ICallout

updateLayout
() => void
updateLayout can be called to force the callout to recompute its position and location if it is using a relative layout. This means that contentLocation was not specified, and instead an element or point was used to position it.

ICalloutProps

anchorElement
HTMLElement
If the callout is being positioned relative to an existing element in the DOM the relative element should be supplied as the anchorElement. (anchorOrigin should be supplied with anchorElement)
anchorOffset
IOffset
anchorOffset is used to shift the location of the callout from the defined location by a fixed amount. An example might be the tooltip callout defaults to an anchorOffset of { x: 8 y: 8 } from the mouse position.
anchorOrigin
IOrigin
When an anchorElement is supplied the anchorOrigin is used to describe the relative location of the callout with respect to the anchorElement. A common example here is a dropdown button aligns the callout to the bottom-right of the button.
anchorPoint
IPoint
Instead of using an anchorElement to position the callout, if can be positioned based on a fixed location. The anchorPoint defines the fixed position for the anchor.
ariaDescribedBy
string
Id of another element which describes this one for screen reader users.
ariaLabel
string
ariaLabel allows the root element to describe the elements contents to assistive technology.
ariaLabelledBy
string
Id of another element which labels this one for screen reader users. Defaults to this checkbox's label element.
blurDismissfalse
boolean
This will dismiss the callout once it gets and then loses focus. Callouts should dismiss when they lose focus unless they are intended to be modeless UI.
calloutOrigin
IOrigin
calloutOrigin works in conjunction with the other position styles; anchorElement, anchorOffset, anchorOrigin, anchorPoint. After determining the location based on the anchor properties the position of the callout is applied. Example: Again the DropDownButton uses anchorOrigin -> Bottom, right with no offset. This means the anchorPoint will be the bottom right of the button. The calloutOrigin is defined as top, right. This will position the top, right corner of the callout on the bottom right of the button.
className
string
Optional CSS className to apply to the callout element.
contentClassName
string
Optional CSS className to apply to the content element of the callout.
contentJustification
Justification of the callout content within the callout. This defaults to auto layout and will take on the content size. This ONLY applies to window relative layouts, use contentLocation to use this.
contentLocation
This needs to be supplied for a window relative layout. Otherwise the anchorElement is used as the location basis.
contentOrientation
Orientation of the callout, is this a column or a row. This ONLY applies to window relative layouts, use contentLocation to use this.
contentRef
React.RefObject<HTMLDivElement>
Optional ref to be passed to the top level callout element.
contentShadow
boolean
Should the callout have the standard callout shadow.
contentSize
If supplied there are a set of well-known fixed size callout's designed to keep things like panels and other types of information using a consistent layout. This ONLY applies to window relative layouts, use contentLocation to use this. This should be supplied when you are following a standard UI model size.
escDismiss
boolean
The callout will handle keyboard events and when the escape key is pressed the callout will close if the the event hasnt had the defaultPrevented.
fixedLayout
boolean
fixedLayout is used to determine whether or not the callout should be moved based on visibility. if fixedLayout is set to true the callout wont be moved.
focuszoneProps
focuszoneProps allows the caller to manage the how the elements in the callout content are rendered.
height
number
Optional height to use for a custom size.
id
string
If the id supplied, this id will be added to the callout element as the DOM id attribute.
lightDismiss
boolean
The callout element will trap mouse events and dismiss the callout when a click occurs. This will prevent the events from being handled by the underlying elements outside the callout's contents.
modal
boolean
The callout element will be given a class that is a semi-transparency that helps the user understand the user should focus on the callout and dismiss it before interacting with the underlying document.
onAnimationEnd
(event: React.AnimationEvent<HTMLDivElement>) => void
Callback for when an animation on the Callout element ends. Useful when the callout hide/show is animated and the caller wants to know when it completes.
onDismiss
() => void
Method that is called when the callout is dismissed.
onKeyDown
(event: React.KeyboardEvent<HTMLElement>) => void
Callback for when a key is pressed down.
onMouseEnter
(event: React.MouseEvent<HTMLElement>) => void
Callback for when the mouse enters the callout.
onMouseLeave
(event: React.MouseEvent<HTMLElement>) => void
Callback for when the mouse leaves the callout.
portalProps
The portalProps allow the caller to control how the Callout's portal are configured. The default will create the portal as a full screen element rooted in the body.
role
string
role is used to define the assistive usage of this callout. The default is "dialog", but can be overriden with this property.
updateLayoutfalse
boolean
If updateLayout is set to true, the component is re-laid out each time new props are passed in. If not the callout's layout is not updated.
viewportChangeDismisstrue
boolean
This will dismiss the callout if viewport changes such as a scroll or a resize
width
number
Optional width to use for a custom size.

Loaded Callout page