Theme

npm_versionnpm Paragon package page

Basic Usage with Paragon Icon

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

With tooltips

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

Active State

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

isActive=true with inverted colors

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

Inverted Colors

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

Sizes

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

Props API#

IconButton Props API
  • className string

    A custom class name.

  • iconAs PropTypes.elementType as any

    Component that renders the icon, currently defaults to FontAwesomeIcon, but is going to be deprecated soon, please use Paragon's icons instead.

  • src PropTypes.elementType as any

    An icon component to render. Example import of a Paragon icon component: import { Check } from '@openedx/paragon/icons';

  • alt string Required

    Alt text for your icon. For best practice, avoid using alt text to describe the image in the IconButton. Instead, we recommend describing the function of the button.

  • invertColors bool

    Changes icon styles for dark background

    Defaultfalse
  • icon PropTypes.shape({ prefix: PropTypes.string, iconName: PropTypes.string, // eslint-disable-next-line react/forbid-prop-types icon: PropTypes.array, }) as any

    Accepts a React fontawesome icon.

  • iconClassNames string

    Extra class names that will be added to the icon

  • onClick func

    Click handler for the button

    Default() => {}
  • variant enum'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'light' | 'dark' | 'black' | 'brand'

    Type of button (uses Bootstrap options)

    Default'primary'
  • size enum'sm' | 'md' | 'inline'

    size of button to render

    Default'md'
  • isActive bool

    whether to show the IconButton in an active state, whose styling is distinct from default state

    Defaultfalse
  • children any
IconButtonWithTooltip Props API
  • tooltipPlacement string

    tooltip placement can be top, left, right etc, per https://popper.js.org/docs/v2/constructors/#options

    Default'top'
  • tooltipContent node Required

    any valid JSX or text to be rendered as tooltip contents

  • variant enum'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'light' | 'dark' | 'black' | 'brand'

    Type of button (uses Bootstrap options)

  • invertColors bool

    Changes icon styles for dark background

  • iconAs unknown type | unknown type
  • className string

    Additional CSS class[es] to apply to this button

  • alt string Required

    Alt text for your icon. For best practice, avoid using alt text to describe the image in the IconButton. Instead, we recommend describing the function of the button.

  • src unknown type

    An icon component to render. Example import of a Paragon icon component: import { Check } from '@openedx/paragon/icons';

  • iconClassNames string

    Extra class names that will be added to the icon

  • onClick unknown type

    Click handler for the button

  • isActive unknown type

    whether to show the IconButton in an active state, whose styling is distinct from default state

  • icon unknown type
  • size unknown type | unknown type | unknown type

    size of button to render

  • children unknown type

    no children

Usage Insights#

IconButton

Project NameParagon VersionInstance Count
frontend-app-admin-portal21.13.113
frontend-app-authn22.10.04
frontend-app-communications22.7.03
frontend-app-course-authoring22.8.138
frontend-app-discussions22.7.012
frontend-app-enterprise-public-catalog21.13.12
frontend-app-gradebook22.8.11
frontend-app-learner-dashboard22.9.01
frontend-app-learner-portal-enterprise21.13.15
frontend-app-learner-record22.10.01
frontend-app-learning22.8.18
frontend-app-library-authoring21.11.34
frontend-app-ora-grading21.11.35
frontend-app-support-tools21.13.13
frontend-component-header-edx21.13.12
frontend-component-header22.10.01
prospectus20.46.27

IconButtonWithTooltip

Project NameParagon VersionInstance Count
frontend-app-admin-portal21.13.15
frontend-app-course-authoring22.8.129
frontend-app-discussions22.7.01
frontend-app-learner-portal-enterprise21.13.12
frontend-app-library-authoring21.11.31
frontend-app-support-tools21.13.12