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

@manishcodefire/codefire-dropdown

v1.0.7

Published

This is codefire dropdown

Downloads

9

Readme

Single and Multi Select Dropdown Library.

Installation

1.Install the package via npm:

npm install @manishcodefire/codefire-dropdown

Code snippets:

2.Here's an example of how you can use the component

import {StyleSheet, View} from 'react-native';
import React from 'react';
import {SingleSelectDropdown} from '@manishcodefire/codefire-dropdown';

const App = () => {
const imageRoute1 = require('../../assets/openDropdown.png');
const imageRoute2 = require('../../assets/closeDropdown.png');
  const classes = [
    {id: '1', room: 'One'},
    {id: '2', room: 'Two'},
    {id: '3', room: 'Three'},
    {id: '4', room: 'Four'},
    {id: '5', room: 'Five'},
  ];

  return (
    <View style={styles.container}>
      <View style={{justifyContent: 'center', alignItems: 'center'}}>
        <SingleSelectDropdown
          items={classes}
          onSelectOption={e => console.log(e)}
          openDropdownImage={imageRoute1}
          closeDropdownImage={imageRoute2}
          width={'85%'}
          dropdownWidth={'85%'}
          borderWidth={1}
          borderColor={'#8e8e8e'}
          height={50}
          borderRadius={10}
          dropdownHeight={300}
          dropdownBg={'#ffffff'}
          dropdownBorderRadius={10}
          dropdownMarginTop={5}
          itemsBorderBottomWidth={1}
          itemHeight={50}
          itemsBorderBottomColor={'#e7e7e7'}
          itemTextColor={'#8e8e8e'}
          itemFontSize={15}
          backgroundColor={null}
        />
      </View>
    </View>
  );
};

export default App;

const styles = StyleSheet.create({
  container: {marginTop: 50, alignItems: 'center', width: '100%', flex: 1},
  heading: {color: '#000000', fontSize: 16, fontWeight: 'bold'},
});

Single Select Dropdown Props:

Props

| Props Name | Params | isRequire | Description | | ---------------------- | ------------ | --------- | ---------------------------------------------------- | | items | Array | Yes | The list of items to display in the dropdown. | | onSelectOption | Function | Yes | Callback function called when an option is selected. | | width | string | No | Width of the dropdown box | | borderWidth | Number | No | Border width of the dropdown box | | borderColor | String | No | Border color of the dropdown box | | height | Number | No | Height of the dropdown box | | borderRadius | Number | No | Border radius of the dropdown box | | dropdownHeight | Number | No | Height of the dropdown list | | dropdownBg | String | No | Background color of the dropdown list | | dropdownBorderRadius | Number | No | Border radius of the dropdown list | | dropdownMarginTop | Number | No | Margin top of the dropdown list | | itemsBorderBottomWidth | Number | No | Border bottom width of the dropdown list items | | itemHeight | Number | No | Height of each dropdown list item | | itemsBorderBottomColor | String | No | Border bottom color of the dropdown list items | | itemTextColor | String | No | Text color of the dropdown list items | | itemFontSize | Number | No | Font size of the dropdown list items | | backgroundColor | String | No | Background color of the dropdown box | | openDropdownImage | String(path) | No | Image for opening the dropdown | | closeDropdownImage | String(path) | No | Image for closing the dropdown |

Multi Select Dropdown Code snippets:

2.Here's an example of how you can use the component


import {StyleSheet, View} from 'react-native';
import React from 'react';
import {MultiSelectDropdown} from '@manishcodefire/codefire-dropdown';

const Dropdown = () => {
  const imageRoute1 = require('../../assets/openDropdown.png');
  const imageRoute2 = require('../../assets/closeDropdown.png');
  const classes = [
    {id: '1', name: 'One'},
    {id: '2', name: 'Two'},
    {id: '3', name: 'Three'},
    {id: '4', name: 'Four'},
    {id: '5', name: 'Five'},
    {id: '6', name: 'Six'},
    {id: '7', name: 'Seven'},
    {id: '8', name: 'Eight'},
    {id: '9', name: 'Nine'},
    {id: '10', name: 'Ten'},
    {id: '11', name: 'Eleven'},
    {id: '12', name: 'Twelve'},
  ];

  return (
    <View style={styles.container}>
      <MultiSelectDropdown
        items={classes}
        sorting={true}
        closeDropdownImage={imageRoute2}
        openDropdownImage={imageRoute1}
        onSelect={e => console.log(e)}
      />
    </View>
  );
};

export default Dropdown;

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
});

Multi Select Dropdown Props

| Props Name | Params | isRequire | Description | | ------------------------------ | ------------ | --------- | --------------------------------------------------------------- | | items | Object[] | Yes | The list of items to display in the dropdown. | | sorting | boolean | Yes | Flag indicating whether to sort the items alphabetically. | | onSelect | Function | Yes | Callback function called when items are selected. | | width | String | No | Width of the dropdown component | | inputBoxPadding | Number | No | Padding for the input box | | inputBoxBorderWidth | Number | No | Border width for the input box | | inputBoxBorderColor | String | No | Border color for the input box | | inputBoxBorderRadius | Number | No | Border radius for the input box | | placeholder | String | No | Placeholder text for the input box | | paceholderFontSize | Number | No | Font size for the placeholder text | | placeholderTextColor | String | No | Text color for the placeholder text | | selectedItemsBoxBg | String | No | Background color for the selected items box | | selectedItemsBoxPadding | Number | No | Padding for the selected items box | | selectedItemsBoxBorderRadius | Number | No | Border radius for the selected items box | | selectedItemsBoxMarginRight | Number | No | Margin right for the selected items box | | selectedItemsBoxMarginBottom | Number | No | Margin bottom for the selected items box | | selectedItemsFontSize | Number | No | Font size for the selected items text | | selectedItemsTextColor | String | No | Text color for the selected items text | | dropdownBorderWidth | Number | No | Border width for the dropdown list | | dropdownBorderColor | String | No | Border color for the dropdown list | | dropdownBorderRadius | Number | No | Border radius for the dropdown list | | dropdownBg | String | No | Background color for the dropdown list | | dropdownMaxHeight | Number | No | Maximum height for the dropdown list | | dropdownMarginTop | Number | No | Margin top for the dropdown list | | selectedItemsPadding | Number | No | Padding for the selected items in the dropdown list | | selectedItemsBottomBorder | Number | No | Bottom border width for the selected items in the dropdown list | | selectedItemsBottomBorderColor | String | No | Bottom border color for the selected items in the dropdown list | | selectedItemsTextSize | Number | No | Text size for the selected items in the dropdown list | | dropdownSelectedTextColor | String | No | Text color for the selected items in the dropdown list | | closeDropdownImage | String(path) | No | Image for closing the dropdown | | openDropdownImage | String(path) | No | Image for opening the dropdown |