Giter Site home page Giter Site logo

whizkydee / dropd Goto Github PK

View Code? Open in Web Editor NEW
73.0 2.0 15.0 1.78 MB

⚡️Zero-dependency minimalistic dropdown component for React and Vue.

Home Page: https://npm.im/dropd-component

License: MIT License

JavaScript 79.96% SCSS 20.04%
dropdown dropdown-menu react-component vue-component ui-component select

dropd's People

Contributors

dependabot[bot] avatar samie820 avatar whizkydee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dropd's Issues

Add support for slots

Make it possible for the user to completely take control of dropd-list, dropd-item and dropd-toggle via Vue slots and a similar workaround in React, with relevant props bound to them.

⚒ Proposed API

  • React
<Dropd {...props}>
  <Dropd.List>
      ...
      <Dropd.Item>
        ...
    </Dropd.Item>
  </Dropd.List>

  <Dropd.Toggle>
    ...
  </Dropd.Toggle>
</Dropd>
  • Vue
<dropd {...props}>
  <ul slot="dropd-list">
    ...
    <li slot="dropd-item">
      ...
    </li>
  </ul>

  <button slot="dropd-toggle">
    ...
  </button>
</dropd>

Improve overall Accessibility

Right now, a couple of things are missing in terms of accessibility of the elements. These include:

  • Proper tab indexing
  • Functional focus and blur states... etc

We should fix this.

Add `revealOn` feature

Add a revealOn prop which would accept either mousedown or mouseover values (with default set to mousedown), and would only trigger dropd on that event.

Add `noDuplicates` feature

Add a noDuplicates prop which would ensure that all items in the list prop is unique.

Already started working on it -- was good for an array of strings, but requires extra logic to filter duplicates from an array of objects.

Styling dropdown

Hi @whizkydee, thanks for putting this great library!

I couldn't find any instruction on customizing the style, how do you recommend doing it?

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.