<juicy-popover>
is a (vanilla) Custom Element that expands an area when clicked on a handle.
It is flexible enough to be used to create dropdowns, combo boxes, tooltips, etc.
-
Install the component using Bower:
$ bower install juicy-popover --save
-
Import Web Components' polyfill (optional, allows to run it in old browsers):
<script src="//cdn.jsdelivr.net/webcomponentsjs/0.5.5/webcomponents.min.js"></script>
-
Import Custom Element:
<link rel="import" href="bower_components/juicy-popover/src/juicy-popover.html">
-
Start using it!
<juicy-popover position="bottom left"> <button slot="handle">▼</button> <div slot="expendable"> You only see me when the button is pressed </juicy-popover>
Attribute | Type | Default | Description |
---|---|---|---|
position |
String | bottom left |
Position of expandable after button is pressed. Possible values: top or bottom , left or right (space separated) |
disabled |
Bool | false |
If true, element won't expand. If already expanded, it will collapse once set to true. Synchronised with property disabled |
expanded |
Bool | false |
Determines whether it's expanded. Synchronised with property expanded and event expanded-changed |
Name | Description |
---|---|
handle |
Slot to set on the handle child node in <juicy-popover> light DOM |
expandable |
Slot to set on the expandable child node in <juicy-popover> light DOM |
Name | Param name | Type | Description |
---|---|---|---|
expand |
Expand the expandable | ||
elem | Element | DOM element is used as the reference to the position of the expandable (normally this is the handle) | |
collapse |
Collapse the expandable | ||
reposition |
Repositions popover |
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
MIT