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 elementType

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

  • src element | elementType

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

    Defaultnull
  • 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 shape {
    prefix: string,
    iconName: string,
    icon: array,
    }

    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
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)

    Default'primary'
  • invertColors bool

    Changes icon styles for dark background

    Defaultfalse

Usage Insights#

IconButton

Project NameParagon VersionInstance Count
frontend-app-admin-portal20.46.39
frontend-app-authn20.46.24
frontend-app-communications20.46.23
frontend-app-course-authoring21.5.618
frontend-app-discussions20.46.311
frontend-app-gradebook20.45.01
frontend-app-learner-dashboard20.46.22
frontend-app-learner-portal-enterprise20.45.41
frontend-app-learner-record20.46.31
frontend-app-learning20.46.05
frontend-app-library-authoring21.5.63
frontend-app-ora-grading20.46.35
frontend-app-support-tools20.46.01
frontend-component-header-edx21.5.62
frontend-lib-content-components21.5.619
prospectus20.46.27

IconButtonWithTooltip

Project NameParagon VersionInstance Count
frontend-app-admin-portal20.46.32
frontend-app-course-authoring21.5.69
frontend-app-library-authoring21.5.62
frontend-app-support-tools20.46.02
frontend-lib-content-components21.5.66