Catalog npm
PACKAGE EXPLORERView in registry

@0xaf4/react-native-dropdown-custom

npm

A single pure component for drop-down/combobox in react native

dropdownnativereactreact-native-dropdown
Versions collected1
Direct dependencies5From release 1.0.2
Last observed20 Oct, 22:39 UTC

README

Current package documentation

@febfeb/react-native-dropdown

A single pure component for drop-down/combobox in react native

react-native-dropdown

Requirement

Please install react-native-vector-icons

Instalation

yarn add @febfeb/react-native-dropdown

Usage (Simple)

import Dropdown from '@febfeb/react-native-dropdown';

let fruits = [
    { id: 1, label: 'Apple'},
    { id: 2, label: 'Orange'},
    { id: 3, label: 'Pineapple'},
];

const [fruit, setFruit] = useState(1);

return (
    <Dropdown
        label='Select fruit'
        value={fruit}
        data={fruits}
        onChange={(val) => {
            setFruit(val);
        }}/>
);

Usage (Dark Theme)

import Dropdown from '@febfeb/react-native-dropdown';

let fruits = [
    { id: 1, label: 'Apple'},
    { id: 2, label: 'Orange'},
    { id: 3, label: 'Pineapple'},
];

const [fruit, setFruit] = useState(1);

const theme = {
    boxStyle: {
        borderColor: 'blue',
    },
};

return (
    <Dropdown
        label="Select fruit"
        theme={{
            containerStyle: {
                backgroundColor: '#000',
            },
            boxStyle: {
                backgroundColor: '#000',
                borderColor: '#fff',
            },
            labelStyle: {
                color: '#fff',
            },
            textContentStyle: {
                color: '#fff',
            },
            rightIconStyle: {
                color: '#fff',
            },
            modalRootStyle: {
                backgroundColor: 'rgba(255,255,255,0.5)',
            },
            modalContentStyle: {
                backgroundColor: '#000',
            },
            searchWrapperStyle: {
                backgroundColor: '#222',
            },
            searchIconStyle: {
                color: '#fff',
            },
            searchInputStyle: {
                color: '#fff',
            },
            listStyle: {
                backgroundColor: '#000',
            },
            listTextStyle: {
                color: "#fff",
            },
        }}
        placeholderTextColor={'rgba(255,255,255,0.8)'}
        value={fruit}
        data={fruits}
        onChange={(val) => {
            setFruit(val);
        }}
    />
);

Props

PropTypeDescription
valuestring/numberThis is mandatory for selecting the default value
dataarray of object with id and label attributeUsed as array of source data
labelstringTitle
onChangefunctionThis event will be triggered after user click the list item
renderDisplayfunctionUse this function to custom render your dropdown
showSearchBarbooleanUse this to show search bar (default false)
themeObjectThis is if you want to customize the appearance
placeholderTextColorstring colorThis is if you want to customize the placeholderTextColor props in TextInput

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.2Registry latest8 Apr 20255

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
febfeb/react-native-dropdown

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:39 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:7482d3b4a77a7d4f07994c7e24641eb774ed1bf14503d6693faeb2b14fb50540