Theme

PlaygroundBeta

npm_versionnpm Paragon package page

IconButton

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

    An icon component to render. Example import of a Paragon icon component: import { Check } from '@edx/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,
    }
  • 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.26.38
frontend-app-authn20.34.05
frontend-app-communications20.30.13
frontend-app-course-authoring20.32.05
frontend-app-discussions20.15.011
frontend-app-gradebook19.25.41
frontend-app-learner-dashboard20.32.03
frontend-app-learner-portal-enterprise20.31.11
frontend-app-learner-record20.32.01
frontend-app-learning20.28.45
frontend-app-library-authoring20.30.13
frontend-app-ora-grading20.30.05
frontend-app-profile20.32.31
frontend-lib-content-components20.32.016
prospectus20.32.36

IconButtonWithTooltip

Project NameParagon VersionInstance Count
frontend-app-support-tools20.26.01
frontend-lib-content-components20.32.05