Chip
Chips are compact elements that represent an input, attribute, or action. Similar to the Badge component, but interactive.
Basic Usage
With icon before and after
Theme Variables (SCSS)#
$chip-padding-x: .5rem !default;$chip-padding-y: .125rem !default;$chip-padding-to-icon: 3px !default;$chip-icon-padding: .25rem !default;$chip-margin: .125rem !default;$chip-border-radius: .25rem !default;$chip-disable-opacity: .3 !default;$chip-icon-size: 1.25rem !default;$chip-theme-variants: ("light": ("background": $light-500,"color": $black,),"dark": ("background": $dark-200,"color": $white,)) !default;
Chip Props API
- children
nodeRequired RequiredSpecifies the content of the
Chip. - className
stringRequiredSpecifies an additional
classNameto add to the base element. - variant
enumRequired'light' | 'dark'Default'light'The
Chipstyle variant to use. - disabled
boolRequiredDefaultfalseDisables the
Chip. - iconBefore
elementRequired |funcRequired RequiredAn icon component to render before the content. Example import of a Paragon icon component:
import { Check } from '@edx/paragon/icons'; - iconAfter
elementRequired |funcRequired RequiredAn icon component to render before after the content. Example import of a Paragon icon component:
import { Check } from '@edx/paragon/icons'; - onIconAfterClick
funcRequiredA click handler for the
Chipicon after. - onIconBeforeClick unknown type
- onLabelClick unknown type