Skip to main content

Chip

Chip component with Pressable as container, and supports full customization with different props. It has both hover and press effect that get picked from the color shades or if custom color is provided it auto generates those colors.

Here, below all the usage are shown with withCheckIcon prop set to true via the component manager, to get this as a default prop.

Usage

Blossom Chip
function ChipUsage() {
return <Chip onPress={() => alert('Chip Pressed')}>Blossom Chip</Chip>
}

View Only

Blossom Chip
function ChipViewOnly() {
return <Chip viewOnly>Blossom Chip</Chip>
}

ChipWithoutCheckIcon

Blossom Chip
function ChipWithoutCheckIcon() {
return <Chip withCheckIcon={false}>Blossom Chip</Chip>
}

ChipClearable

Blossom Chip
function ChipClearable() {
return <Chip clearable>Blossom Chip</Chip>
}

ChipCheckIcon

Custom Icon
function ChipCheckIcon() {
return (
<Chip checkIcon={<Icon name="information-sharp" size={16} />}>
Custom Icon
</Chip>
)
}

ChipAsBadge

2
40
99+
function ChipAsBadge() {
return (
<View row style={{alignItems: 'center'}}>
<Chip size="small" asBadge title="2" />
<Chip size="medium" asBadge title="40" />
<Chip size="large" asBadge title="99+" />
</View>
)
}

Size

small
medium
large
function ChipSizes() {
return (
<View row style={{justifyContent: 'space-evenly'}}>
<Chip size="small" title="small" />
<Chip size="medium" title="medium" />
<Chip size="large" title="large" />
</View>
)
}

Modes

filled
tinted
outlined
plain
function ChipModes() {
return (
<View row style={{justifyContent: 'space-evenly'}}>
<Chip mode="filled" title="filled" />
<Chip mode="tinted" title="tinted" />
<Chip mode="outlined" title="outlined" />
<Chip mode="plain" title="plain" />
</View>
)
}

Disabled

filled
tinted
outlined
plain
function ChipDisabled() {
return (
<View row style={{justifyContent: 'space-evenly'}}>
<Chip disabled mode="filled">
filled
</Chip>
<Chip disabled mode="tinted">
tinted
</Chip>
<Chip disabled mode="outlined">
outlined
</Chip>
<Chip disabled mode="plain">
plain
</Chip>
</View>
)
}

ChipModesSizesMobile

tinted
tinted
tinted
tinted
tinted
tinted
tinted
tinted
tinted
tinted
tinted
tinted

ChipAllStatuses

primary
primary
primary
primary
accent
accent
accent
accent
success
success
success
success
info
info
info
info
warning
warning
warning
warning
error
error
error
error

Custom Chips

Custom Chip
function ChipCustom() {
return (
<View style={{justifyContent: 'space-evenly'}}>
<Chip
style={[{backgroundColor: 'cyan'}]}
left={<Icon name="add" size={16} color="white" />}
right={<Icon name="add" size={16} color="white" />}>
Custom Chip
</Chip>
</View>
)
}

Props

PropData TypeDefault ValueDescription
ExtendsButtonProps--Inherits properties from ButtonProps
checkIconReactNode--Use any custom icon for selected state
isSelectedboolean--Set it to true if selected
withCheckIconboolean--Show the select icon
clearableboolean--Show the close icon at right to clear the selection
viewOnlyboolean--Set it to true to make it unselectable
onClearPress() => void--On clear callback
asBadgeboolean--Render it as a badge
modeButtonModefilledChange the appearance of the button using this
titlestring--Button title text
titleStyleStyleProp<TextStyle>--Title text style
styleStyleProp<ViewStyle>--Button style to add padding/margin etc.
isLoadingboolean--Set it to true to show the activity indicator to the left
disabledboolean--Set to true to disable the button
disabledStyleStyleProp<ViewStyle>--button style for disabled state
disabledTitleStyleStyleProp<TextStyle>--button text style for disabled state
leftReactNode--Render any icon/JSX on left of the title
rightReactNode--Render any icon/JSX on right of the title
loaderPropsActivityIndicatorProps--Loader props
statusBlossomStatusprimary--
sizeBlossomSizemedium--