vue-balloon
A zoomable fixed balloon container. Useful for adding tutorial videos or other page specific content.
Vue.js plugin to create a floating element that expands when clicked.
Author
kevinwarne
Dependencies
This plugin uses font awesome icons so either include that or redefine custom icons for the classes .fa-chevron-up
, .fa-chevron-down
, .fa-expand
, .fa-compress
, .fa-close
.
Install & Basic Usage
Add as dependency with npm or yarn.
npm install vue-balloon --save
or
yarn add vue-balloon
Multiple Balloons
To achieve multiple fixed balloons on the same page we use Vue's scoped slot functionality paired with the vue-balloon BalloonSet component.
Caveats and Gotchas
For multiple balloons with the BalloonSet component:
- Whenever a balloon is
maximized
to take up most of the window it will re-render the slot contents from scratch. - If you need to have reactive data inside each balloon it is recommended to store it inside of a nested balloon object. Otherwise the attributes are considered slot props and cannot be modified. For example:
Component: Balloon
methods
These methods are exposed by the balloon component if needed:
events
These events are emitted from the balloon component.
v-on:
close
: when the balloon is closedv-on:
open
: when the balloon is openedv-on:
maximize
: when the balloon is maximizedv-on:
minimize
: when the balloon is minimized
props
Component: BalloonSet
BalloonSet was added in vue-balloon v1.0.18