0.0.21 • Published 5 years ago

cavemen v0.0.21

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

Cavemen

Primitive React Components

PLEASE NOTE: At this current time, searchable cannot be used with multiple

Dropdown

PropDescriptionTypeRequiredDefault Value
optionsAn array of Option type to displayOption[]*-
onChangeAn event handler for when an Option is selected.Handler*-
clearableWhether or not the Dropdown Option can be clearedBooleanfalse
defaultA default Option to be selectedOption-
disabledWhether or not the Dropdown is disabledBooleanfalse
idAn ID to append to the Dropdown wrapperString-
labelA label for the Dropdown - appears directly above itString-
multipleWhether or not the Dropdown should be a mult-selectBooleanfalse
openWhether or not the Dropdown is open on renderBooleanfalse
placeholderPlaceholder text before a user selects an optionString-
searchableAllows users to search for OptionBooleanfalse
triggerA component passed down as a trigger - for example, if you want an icon to have dropdown functionalityReactNode-

Dropdown Types

Option

interface Option {
    value: string | number,
    name: string
}

Handler

type Handler = (option: Option | Option[] | null, event: SyntheticEvent) => void;