Theme

PlaygroundBeta

npm_versionnpm Paragon package page

Chip

Chips are compact elements that represent an input, attribute, or action. Similar to the Badge component, but interactive.

Basic Usage

Any Paragon component or export may be added to the code example.

With Icon Before and After

Any Paragon component or export may be added to the code example.

Any Paragon component or export may be added to the code example.

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;

Props API#

Chip Props API
  • children node Required

    Specifies the content of the Chip.

  • className string

    Specifies an additional className to add to the base element.

  • variant enum'light' | 'dark'

    The Chip style variant to use.

    Default'light'
  • disabled bool

    Disables the Chip.

    Defaultfalse
  • iconBefore element | func

    An icon component to render before the content. Example import of a Paragon icon component:

    import { Check } from '@edx/paragon/icons';

  • onIconBeforeClick func

    A click handler for the Chip icon before.

  • iconAfter element | func

    An icon component to render before after the content. Example import of a Paragon icon component:

    import { Check } from '@edx/paragon/icons';

  • onIconAfterClick func

    A click handler for the Chip icon after.

Usage Insights#

Chip

Project NameParagon VersionInstance Count
frontend-app-learner-dashboard20.19.02
frontend-app-learner-portal-enterprise20.31.13
frontend-app-profile20.32.32