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.112
frontend-app-authn22.7.04
frontend-app-communications22.0.03
frontend-app-course-authoring22.6.125
frontend-app-discussions22.1.111
frontend-app-enterprise-public-catalog21.13.12
frontend-app-gradebook22.1.11
frontend-app-learner-dashboard22.7.02
frontend-app-learner-portal-enterprise21.13.11
frontend-app-learner-record22.7.01
frontend-app-learning22.3.010
frontend-app-library-authoring21.11.34
frontend-app-ora-grading21.11.35
frontend-app-support-tools20.46.01
frontend-component-header-edx21.11.42
frontend-component-header22.7.01
frontend-lib-content-components22.0.019
prospectus20.46.27

IconButtonWithTooltip

Project NameParagon VersionInstance Count
frontend-app-admin-portal21.13.14
frontend-app-course-authoring22.6.123
frontend-app-learner-portal-enterprise21.13.12
frontend-app-library-authoring21.11.31
frontend-app-support-tools20.46.02
frontend-lib-content-components22.0.06