GithubHelp home page GithubHelp logo

mihaiii / juicy-popover Goto Github PK

View Code? Open in Web Editor NEW

This project forked from juicy/juicy-popover

0.0 3.0 0.0 27 KB

Custom Element that expands an area when clicked on a handle

Home Page: http://juicy.github.io/juicy-popover

License: MIT License

JavaScript 5.39% HTML 94.61%

juicy-popover's Introduction

<juicy-popover>

<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.

Demo

Check it live!

Usage

  1. Install the component using Bower:

    $ bower install juicy-popover --save
  2. 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>
  3. Import Custom Element:

    <link rel="import" href="bower_components/juicy-popover/src/juicy-popover.html">
  4. 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>

Attributes

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

Slots

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

Methods

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

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -m 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.