Code Monkey home page Code Monkey logo

react-dropdown's Introduction

React Dropdown npm version

An accessible, easy to use, customizable dropdown library for the web.

Ongoing work on the library.

React Dropdown Screenshot 1

React Dropdown Screenshot 2

React Dropdown Screenshot 3

Playground

To run demo on your computer

Installing

npm install --save @tgdn/react-dropdown

Usage

import React from 'react'
import {
    Dropdown,
    DropdownMenu,
    DropdownMenuItem,
    DropdownButton
} from '@tgdn/react-dropdown'

const MyMenu = props => {
    return (
        <DropdownButton title='Click me' center>
            <DropdownMenu>
                <DropdownMenuItem>Click me</DropdownMenuItem>
				<DropdownMenuItem>Once more</DropdownMenuItem>
                <DropdownMenuItem>Log out</DropdownMenuItem>
            </DropdownMenu>
        </DropdownButton>
    )
}

Configuration

Different prop types are available for use on DropdownButton or directly on Dropdown

Prop Default Value Description
opened false true/false Whether the dropdown should be visible after mounting
noArrow false true/false If true, no arrow will be displayed. The default is with an arrow, and thus false
arrowLeft false true/false If true, the arrow will be on the left of the dropdown, otherwise arrow stays untouched
arrowRight false true/false If true, the arrow will be on the right of the dropdown, otherwise arrow stays untouched
center false true/false Whether to align the dropdown and the button so they are horizontally aligned
pullLeft false true/false If true, the dropdown will be shifted all the way to the left
pullRight false true/false If true, the dropdown will be shifted all the way to the right
alignLeft false true/false If true, the dropdown will left side will be aligned with the container's left side
alignRight false true/false If true, the dropdown will right side will be aligned with the container's right side

Done

  • Simple UI
  • Reactive Component
  • Dropdown positioning
  • Arrow positioning
  • Dropdown Button and Menu

To do

  • Dynamic positioning on window scroll and window resize
  • More components (simple view, ...)

react-dropdown's People

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

davidmroth

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.