Skip to content

Main instance ​

construct() ​

Create a new main instance by calling constructor.

ArgumentTypeDefaultDescription
optionsBartenderOptions{}Main options
barDefaultOptionsBartenderBarDefaultOptions{}Default options for new bars
javascript
const bartender = new Bartender(
  {
    // Main options
    debug: true,
  },
  {
    // default options for new bars
  },
)

Main options ​

PropertyTypeDefaultDescription
debugbooleanfalseIf enabled, Bartender will log it's activity to console at debug log level.

Default options for new bars ​

PropertyTypeDefaultDescription
position'left' | 'right' | 'top' | 'bottom' | 'center''left'Bar position
modalbooleantrueOpen bar as a modal?
overlaybooleantrueShow overlay shading over the content when bar is open?
permanentbooleanfalseBar is not closeable by clicking overlay of pressing esc key.
scrollTopbooleantrueBar will be scrolled to top after opening it.

destroy() ​

Destroy Bartender instance.

javascript
bartender.destroy()

Released under the MIT License.