npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-material-dropdown-axel

v1.1.0

Published

Material dropdown

Downloads

3

Readme

react-native-material-dropdown

npm license codeclimate

Material dropdown with consistent behaviour on iOS and Android

example

Features

  • Easy to use
  • Consistent look and feel on iOS and Android
  • Customizable font size, colors and animation duration
  • Dynamic dropdown size and position
  • Configurable visible item count
  • RTL support
  • Pure javascript implementation

Installation

npm install --save react-native-material-dropdown

Usage

import React, { Component } from 'react';
import { Dropdown } from 'react-native-material-dropdown';

class Example extends Component {
  render() {
    let data = [{
      value: 'Banana',
    }, {
      value: 'Mango',
    }, {
      value: 'Pear',
    }];

    return (
      <Dropdown
        label='Favorite Fruit'
        data={data}
      />
    );
  }
}

Properties

name | description | type | default :----------------- |:--------------------------------------------- | --------:|:------------------ label | Text field label text | String | - error | Text field error text | String | - animationDuration | Text field animation duration in ms | Number | 225 fontSize | Text field font size | Number | 16 labelFontSize | Text field label font size | Number | 12 baseColor | Text field base color | String | rgba(0, 0, 0, .38) textColor | Text field text color | String | rgba(0, 0, 0, .87) itemColor | Dropdown item text color (inactive item) | String | rgba(0, 0, 0, .54) selectedItemColor | Dropdown item text color (active item) | String | rgba(0, 0, 0, .87) disabledItemColor | Dropdown item text color (disabled item) | String | rgba(0, 0, 0, .38) dropdownPosition | Dropdown position (dynamic if undefined) | Number | - itemCount | Dropdown visible item count | Number | 4 itemPadding | Dropdown item vertical padding | Number | 8 itemTextStyle | Dropdown item text styles | Object | - itemTextProps | Dropdown item text props | Object | - dropdownOffset | Dropdown offset | Object | { top: 32, left: 0 } dropdownMargins | Dropdown margins | Object | { min: 8, max: 16 } data | Dropdown item data | Array | [] value | Selected value | String | - containerStyle | Styles for container view | Object | - overlayStyle | Styles for overlay view | Object | - pickerStyle | Styles for item picker view | Object | - shadeOpacity | Shade opacity for dropdown items | Number | 0.12 rippleOpacity | Opacity for ripple effect | Number | 0.54 rippleInsets | Insets for ripple on base component | Object | { top: 16, bottom: -8 } rippleCentered | Ripple on base component should be centered | Boolean | false renderBase | Render base component | Function | - renderAccessory | Render text field accessory | Function | - valueExtractor | Extract value from item (args: item, index) | Function | ({ value }) => value labelExtractor | Extract label from item (args: item, index) | Function | ({ label }) => label propsExtractor | Extract props from item (args: item, index) | Function | () => null onChangeText | Selection callback (args: value, index, data) | Function | -

Other TextField, TextInput and TouchableWithoutFeedback properties will also work

Methods

name | description | returns :--------------- |:------------------------------ |:-------- focus() | Acquire focus (open dropdown) | - blur() | Release focus (close dropdown) | - value() | Get current value | String selectedIndex() | Get selected index | Number selectedItem() | Get selected item | Object isFocused() | Get current focus state | Boolean

Example

git clone https://github.com/n4kz/react-native-material-dropdown
cd react-native-material-dropdown/example
npm install
npm run ios # or npm run android

Copyright and License

BSD License

Copyright 2017-2018 Alexander Nazarov. All rights reserved.