Skip to main content
Version: 5.4

Modes

Modes display selected items.

  • DEFAULT
  • SIMPLE
  • BADGE
mode="SIMPLE"
TypeDefault
stringSIMPLE
note

Single item pickers won't be affected by the mode property.

Change the default mode

You can change the default mode of the package globally.

DropDownPicker.setMode("BADGE");

Badge Mode Props

showBadgeDot

Shows dots in the badges.

showBadgeDot={true}
TypeDefault
booltrue

badgeProps

Adds native props for the badge container TouchableOpacity.

badgeProps={{
activeOpacity: 0.5
}}

extendableBadgeContainer

Allows the badges to expand in multiple rows.

TypeDefault
boolfalse

Callbacks

renderBadgeItem

Renders the selected items.

renderBadgeItem={(props) => <Badge {...props} />}
note

You need to move it to an independent component otherwise the items will be re-rendered.

Type
function

Styling

badgeStyle

badgeStyle={{
padding: 5
}}

badgeTextStyle

badgeTextStyle={{
fontStyle: "italic"
}}

badgeDotStyle

badgeDotStyle={{
borderRadius: 2
}}

badgeSeparatorStyle

badgeSeparatorStyle={{
width: 30
}}

badgeColors

Gives background colors to badges based on the value.

badgeColors={["red", "blue", "orange"]}
Type
object, string

badgeDotColors

Gives background colors to badge dots based on the value.

badgeDotColors={["red", "blue", "orange"]}
Type
object, string