--- layout : 'default' css : 'popup' title : 'Popup' description : 'A popup displays additional information on top of a page element' type : 'UI Module' --- <%- @partial('header') %>

Types

Popup

A standard popup

Variations

Size

A popup can be large or small

Inverted

A popup can have its colors inverted

Usage

Initializing an popup

$('.ui.popup') .popup() ;

Including metadata

Frequently used metadata like, title, content, html, or arrowOffset or variation, can be included in html metadata

Specifying Content

Popups can specify content in three ways:

  • Using html title attribute
  • Using data-content attribute
  • Using the content property in the initialization of the popup

Examples

Inline or Body

A popup can either be inserted directly after an element, or added as a child element to the page's body.

An inline popup will remain in your page's html after being hidden, while a non-inline popup will remove itself after being hidden.
If you want to style each popup individually it makes sense to keep popup inline: true. If you are worried that your pop up might mistakingly inherit styles that it shouldn't, you should set inline: false.
$('.page.icon') .popup({ inline: false }) ; $('.inline.icon') .popup({ inline: true }) ;

Positioning

A popup can be positioned to any side of an element. If space is not available, it will automatically search for a similar alternative position to use.

Title

A popup can be formatted with a title

HTML

A popup can be formatted with html

Transitions

A popup can have different transitions. Any transition with both an in and out animation can be specified. The following are just a few examples.



$('.fade.icon') .popup('setting', 'transition', 'fade up') .popup('toggle') ;


$('.slide.icon') .popup('setting', 'transition', 'slide up') .popup('toggle') ;


$('.flip.icon') .popup('setting', 'transition', 'vertical flip') .popup('toggle') ;

Settings

Content
content Content to display
title Title to display alongside content
html HTML content to display instead of preformatted title and content
Popup Settings
inline true If a popup is inline it will be created next to current element, allowing for local css rules to apply. It will not be removed from the DOM after being hidden. Otherwise popups will appended to body and removed after being hidden.
delay 0 Delay in milliseconds before showing a popup when using hover events.
variation Popup variation to use, can use multiple variations with a space delimiter
on hover Event used to invoke popup
clickToClose true Whether clicking anywhere outside a popup should close it.
position top center Position that the popup should appear
distanceAway 0 Distance away from element for the popup to appear.
arrowOffset 0 Offset to apply to arrow positioning of element
maxSearchDepth 10 Number of iterations before giving up search for popup position when a popup cannot fit on screen
Animation
transition scale transition to use if transition module is included
duration 250 Duration of popup animation.
easing easeOutQuint Easing equation for popup animation
Callbacks
onCreate None Callback after a popup html is generated.
onShow None Callback after a popup section is shown.
onHide None Callback after a popup section is hidden.
UI Module Settings
Name Popup Name used in debug logs
debug True Provides standard debug output to console
performance False Provides performance output to console
verbose False Provides ancillary debug output to console
namespace popup Event namespace. Makes sure module teardown does not effect other events attached to an element.
errors
errors : { method : 'The method you called is not defined.' }