Skip to main content

Chip

Import

import { Chip } from '@sparrowengg/twigs-react';
Result
Loading...
<Chip> Sparrow </Chip>

Closable chip

Result
Loading...
<Chip closable onClose={() => alert("Chip closed")}>
  Sparrow
</Chip>

Selectable chip

Result
Loading...
<Chip color="primary" size="lg" selectable>
  Sparrow
</Chip>

Chip with side elements

Result
Loading...
<Chip
  color="primary"
  size="lg"
  leftElement={<TickCircleFillIcon />}
  rightElement={<ChevronDownIcon />}
>
  Sparrow
</Chip>

Props

PropertyDescriptionTypeDefault
variantstyle of the chipoutline solidsolid
colordefault primary success error warningdefault
sizexs sm md lgsm
roundedborder radius of the chipsm fullsm
closableadd a close icon after the chip contentbooleanfalse
onCloseCallback function for closable iconfunction
leftElementReact element to display on the left side of the chipReactNodenull
rightElementReact element to display on the left side of the chipReactNodenull
selectableWhether the chip is selectablebooleanfalse
activeWhether the chip is active, if its selectablebooleanfalse
defaultActiveDefault active state of the chip, if its selectablebooleanfalse
onActiveStateChangeCallback function for active state changefunction