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.

Theme Variables#

CSS VariableComputed Value










Props API#

IconButton Props API
  • iconAs React.ComponentType<any>

    Component that renders the icon, currently defaults to Icon

    DefaultIcon
  • 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.

  • invertColors boolean

    Changes icon styles for dark background

    Defaultfalse
  • src React.ComponentType

    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 React.MouseEventHandler<HTMLButtonElement>

    Click handler for the button

    Default() => {}
  • isActive boolean

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

    Defaultfalse
  • icon { prefix?: string; iconName?: string, icon?: any[] }
  • variant 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'light' | 'dark' | 'black' | 'brand'

    Type of button (uses Bootstrap options).

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

    Size of button to render

    Default'md'
  • children never

    No children

IconButtonWithTooltip Props API
  • iconAs React.ComponentType<any>

    Component that renders the icon, currently defaults to Icon

  • 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.

  • invertColors boolean

    Changes icon styles for dark background

  • src React.ComponentType

    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 React.MouseEventHandler<HTMLButtonElement>

    Click handler for the button

  • isActive boolean

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

  • icon { prefix?: string; iconName?: string, icon?: any[] }
  • variant 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'light' | 'dark' | 'black' | 'brand'

    Type of button (uses Bootstrap options).

  • size 'sm' | 'md' | 'inline'

    Size of button to render

  • children never

    No children

  • tooltipPlacement Placement

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

    Default'top'
  • tooltipContent React.ReactNode Required

    Any content to pass to tooltip content area

Usage Insights#

IconButton

Project NameParagon VersionInstance Count
frontend-app-admin-portal21.13.114
frontend-app-authn22.11.24
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.10.08
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