Icon
Displays an svg icon from @edx/paragon/icons
. See Icons Foundation Documentation for a list of all available icons.
Basic Usage
Any Paragon component or export may be added to the code example.
With HTML attributes
HTML attributes can be passed to this component allowing for customization of the color, size, or addition of any necessary ARIA attributes.
Any Paragon component or export may be added to the code example.
Theme Variables (SCSS)#
$icon-inline: .8em !default;$icon-xs: 1rem !default;$icon-sm: 1.25rem !default;$icon-md: 1.5rem !default;$icon-lg: 1.75rem !default;
Props API#
- src
element
|func
DefaultnullAn icon component to render. Example import of a Paragon icon component:
import { Check } from '@edx/paragon/dist/icon';
- svgAttrs
shape
{aria-label:string
,aria-labelledby:}string
,Default{}HTML element attributes to pass through to the underlying svg element
- id
string
the
id
property of the Icon element, by default this value is generated with thenewId
function with theprefix
ofIcon
. - size
enum
'xs' | 'sm' | 'md' | 'lg'The size of the icon.
- className
string
A class name that will define what the Icon looks like.
- hidden
bool
Defaulttruea boolean that determines the value of
aria-hidden
attribute on the Icon span, this value istrue
by default. - screenReaderText
string
|element
a string or an element that will be used on a secondary span leveraging the
sr-only
style for screenreader only text, this value isundefined
by default. This value is recommended for use unless the Icon is being used in a way that is purely decorative or provides no additional context for screen reader users. This field should be thought of the same way analt
attribute would be used forimage
tags.
Usage Insights#
Icon
Project Name | Paragon Version | Instance Count | |
---|---|---|---|
credentials | 19.19.1 | 2 | |
edx-platform | 2.6.4 | 15 | |
frontend-app-account | 20.28.5 | 2 | |
frontend-app-admin-portal | 20.26.3 | 62 | |
frontend-app-authn | 20.34.0 | 20 | |
frontend-app-communications | 20.28.5 | 13 | |
frontend-app-course-authoring | 20.32.0 | 6 | |
frontend-app-discussions | 20.15.0 | 43 | |
frontend-app-enterprise-public-catalog | 20.29.0 | 10 | |
frontend-app-gradebook | 19.25.4 | 12 | |
frontend-app-learner-dashboard | 20.19.0 | 9 | |
frontend-app-learner-portal-enterprise | 20.31.1 | 10 | |
frontend-app-learner-record | 20.28.4 | 4 | |
frontend-app-learning | 20.28.4 | 28 | |
frontend-app-library-authoring | 20.30.1 | 6 | |
frontend-app-ora-grading | 19.9.0 | 14 | |
frontend-app-profile | 20.32.3 | 2 | |
frontend-app-publisher | 20.28.5 | 4 | |
frontend-app-support-tools | 20.26.0 | 4 | |
frontend-lib-content-components | 20.32.0 | 45 | |
frontend-lib-special-exams | 20.22.4 | 3 | |
prospectus | 20.28.3 | 72 | |
studio-frontend | 3.4.8 | 5 |