Icon
Leave feedbackDisplays 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|funcDefaultnullAn 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
stringthe
idproperty of the Icon element, by default this value is generated with thenewIdfunction with theprefixofIcon. - size
enum'xs' | 'sm' | 'md' | 'lg'The size of the icon.
- className
stringA class name that will define what the Icon looks like.
- hidden
boolDefaulttruea boolean that determines the value of
aria-hiddenattribute on the Icon span, this value istrueby default. - screenReaderText
string|elementa string or an element that will be used on a secondary span leveraging the
sr-onlystyle for screenreader only text, this value isundefinedby 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 analtattribute would be used forimagetags.
Usage Insights#
Icon
| Project Name | Paragon Version | Instance Count | |
|---|---|---|---|
| credentials | 19.19.1 | 2 | |
| edx-platform | 2.6.4 | 15 | |
| frontend-app-account | 20.44.0 | 6 | |
| frontend-app-admin-portal | 20.39.2 | 61 | |
| frontend-app-authn | 20.45.5 | 19 | |
| frontend-app-communications | 20.45.0 | 13 | |
| frontend-app-course-authoring | 20.35.1 | 15 | |
| frontend-app-discussions | 20.44.0 | 43 | |
| frontend-app-enterprise-public-catalog | 20.29.0 | 10 | |
| frontend-app-gradebook | 20.45.0 | 12 | |
| frontend-app-learner-dashboard | 20.32.0 | 9 | |
| frontend-app-learner-portal-enterprise | 20.45.1 | 10 | |
| frontend-app-learner-record | 20.45.0 | 4 | |
| frontend-app-learning | 20.28.4 | 29 | |
| frontend-app-library-authoring | 20.45.5 | 6 | |
| frontend-app-ora-grading | 20.45.1 | 14 | |
| frontend-app-payment | 20.45.0 | 1 | |
| frontend-app-profile | 20.45.5 | 1 | |
| frontend-app-publisher | 20.28.5 | 4 | |
| frontend-app-support-tools | 20.45.0 | 6 | |
| frontend-component-header-edx | 20.45.5 | 3 | |
| frontend-component-header | 20.45.5 | 3 | |
| frontend-lib-content-components | 20.45.0 | 47 | |
| frontend-lib-special-exams | 20.29.0 | 3 | |
| prospectus | 20.45.2 | 109 | |
| studio-frontend | 3.4.8 | 5 |