--- layout : 'default' css : '' title : 'Dimmer' type : 'UI Module' ---

You're all signed up for the weekly dog tips newsletter!
Your first edition will be sent on January 22

Dimmer

Dimmers focus a users attention on particular content

Definition

Usage

Dimming a section

Any element can be dimmed using a dimmer.

If a dimmer does not exist inside the element it will be created on first use.
$('.segment:first') .dimmer('toggle') ;

Showing a specific dimmer

If a dimmer is already included on the page, instead of calling dimmer on the section you would like to dim, you can can invoke behaviors directly on the dimmer.

// If a dimmer exists on a page, you can make it appear by calling it directly $('.page.dimmer:first') .dimmer('toggle') ;

Types

Content Dimmer

A dimmer can display content

Content must be included inside .content .center to display centered correctly in the modal.

Dog Photos

Your poodle photo uploaded successfully!

Your poodle photo uploaded successfully!

Page Dimmer

A dimmer can be formatted to be fixed to the page

Hello
Show

Dimmer

A dimmer can exist on its own without defining content that it dims

Dog Photos

States

Active

An active dimmer will dim its parent container

Disabled

A disabled dimmer cannot be activated

Variations

Dimmer

Simple Dimmer

A dimmer can be controlled without javascript

Having any parent element receive the class ui dimmable dimmed will trigger the dimmer to display.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.

Inverted Dimmer

A dimmer can be formatted to have its colors inverted

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.

Behavior

Display

You can display a dimmer by either invoking dimmer show on a section or a dimmer itself. If you choose to dim a dimmable section, a dimmer will automatically be created.

// these two are the same $('.ui.dimmable) .dimmer('show') ; $('.ui.dimmable .dimmer') .dimmer('show') ; // these two as well $('.ui.dimmable) .dimmer('hide') ; $('.ui.dimmable dimmer') .dimmer('hide') ;

Settings

Popup Settings
closable true Whether clicking on the dimmer should close it automatically
duration 500 Duration of dimming animation.
Callbacks
onInit None Callback after a dimmer html is generated.
onShow None Callback after a dimmer section is shown.
onHide None Callback after a dimmer section is hidden.
UI Module Settings
Name Dimmer Name used in debug logs
debug True Provides standard debug output to console
performance False Provides standard debug output to console
verbose False Provides ancillary debug output to console
namespace dimmer 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.' }