React Components

Basic alerts with optional icons.

Example

show code

Props

NameRequiredTypeDescriptionDefault Value
typeOne of 'success', 'info', 'danger', 'warning', 'message'Selection will change icon and color of the alert.
showIconboolIf showIcon exists (and is not set to false) the icon will show. Color will persist regardless of if this is true or not.

If you don't want the background, use Message.

Example

show code

Props

NameRequiredTypeDescriptionDefault Value
typeOne of 'success', 'info', 'danger', 'warning', 'message'Selection will change icon of the message.

Almanac Picker

Customizable, accessible date picker.

Example

show code

Props

NameRequiredTypeDescriptionDefault Value
defaultValueobjectA date object representing the data for the current date in the component.Current Date
hideCloseButtonboolA boolean for hiding the close button.
hideSaveButtonboolA boolean for hiding the save button.
onOpenfuncA function to be run when the almanac is opened.
onChangefuncA function to be run when there is a change to the date.
onOKfuncCustom function to be run when the save button is pressed. Takes in default value as an input and should return true if you want the calendar to close when the save button is pressed.
onCancelfuncA function to be run when the window is closed.
dateFormatstringA string that determines the format of the date.
closeOnSelectboolA boolean that will let you click to select rather than use the save button.
onDateSelectfuncA function to be run when a date is selected.
disableboolA boolean to disable the almanac picker.
headerelementA header element to add to the almanac.
footerelementA footer element to add to the almanac.
prefixlabelstringLabel to add above the prefix label.
i18nStringsobjectInternationalization strings for using the almanac picker in other languages.
headerMonthFormatstringFormatting for the month in the header of the almanac.
holidaysarrayHolidays to block out for selection.
disableWeekendsboolA boolean to make weekends unselectable.
selectRangeobjectAn object representing the selectable date range for the almanac picker and accompanying almanac.
onMonthChangefuncA function to be run when the user changes the month.
maxStartDateobjectA date object that represents the first day your almanac will go to.
maxEndDateobjectA date object that represents the last day your almanac will go to.
useOverlayboolIf true will make the dropdown sit on top of anything it covers, if false, opening dropdown shifts content down to make space for the dropdown.
loadingboolA prop to show loading image when almanac isn't fully loaded.
loadingTextstringLoading Text for the almanac.

Almanac

If you just want to show a calendar, use Almanac.

Example

show code

Props

NameRequiredTypeDescriptionDefault Value
defaultValueobjectInitial focused value on the almanac.
i18nStringsobjectInternaitionalization strings for using the almanac in different languages.
headerMonthFormatstringA string that represents the format for date and year at the top of the almanac component.
holidaysarray of datesAn array of holidays to make unselectable.
disableWeekendsboolA boolean to make weekends unselectable.
selectRangeobjectAn object representing the selectable date range that the calendar will show.
onSelectfuncA function to be called when a date is selected.
onMonthChangefuncA function to be called when the user changes the month.
footerelementA footer element for the almanac.
maxStartDateobjectA date object that represents the first day your almanac will go to.
maxEndDateobjectA date object that represents the last day your almanac will go to.
dateFilterfuncA custom function for filtering the dates.
onResetFocusfuncA function to be executed with the focus is reset.
initialValueobjectA date object that represents the first element you were on when you entered the almanac.

Calculator

This component provides a general calculator functionality that provides a way to do basic mathematical operations.



Things to keep in mind

  • Width of parent container of this component will decide width of component.
  • Maximum 18 digits are allowed as input in the calculator.
  • Keypad C operation will reset the calculator to initial state. That means pre calculated values will be reset to 0.
  • There is a 10 digit precision applied on the result displayed for the calculator.
  • Branding is supported for the input section of the calculator.
  • Keypad % operation will divide by 100 on first time provided user input or calculated value.
  • Keypad % operation will calculate percentage of second input from first input, if user provides first input and do percentage after second input.


Example

show code

Props

NameRequiredTypeDescriptionDefault Value
labelsarrayCarries dynamic labels that need to used in the component, if not provided will use static labels.
localestringCarries locale that need to be used, to find the right static labels.'en_US'

Basic check boxes.

Example

show code

Props

NameRequiredTypeDescriptionDefault Value
isSmallboolif true creates a small checkbox.
disabledboolif true disables the checkbox.
checkedboolif true the checkmark starts as checked.
idstringAdd an id to the label surrounding the input.
onChangefuncA function to be executed whenever there is a change to the checkbox.
dangerouslySetLabelInnerHtmlobjectIf you have a string of html that is absolutely necessary in the label, this prop can be used. The value of this prop is an object containing the key '__html' who's value is the string of html meant to be placed in the label.

A radio button for selection on forms.

Example

show code

Props

NameRequiredTypeDescriptionDefault Value
isSmallboolIf true, the radio button is small.
disabledboolIf true, the radio button is disabled.
isCheckedboolIf true, the radio button is selected.
checkedboolIf true, the radio button defaults to selected when the page loads.
namestringAdd a name attribute to the radio button.
idstringAdd an id to the label surrounding the input.
onChangefuncFunction to be executed when there is a change to the input.
dangerouslySetLabelInnerHtmlobjectIf you have a string of html that is absolutely necessary in the label, this prop can be used. The value of this prop is an object containing the key '__html' whose value is the string of html meant to be placed in the label.

Form input for international phone numbers.

Example

show code

Props

NameRequiredTypeDescriptionDefault Value
classNamestringClassname to add to the top level div.
phoneMinLengthnumberMinimum number of digits for the phone number to be valid.9
phoneMaxLengthnumberMaximum number of digits for the phone number to be valid.16
selectedPhoneCodestringThe international phone code for the selected country.'1'
selectedCountryNamestringThe name of the selected country.'United States'
phoneNumberstringThe phone number to show.''
isInternationalPhoneEnabledboolBoolean to enable international phone dropdown, if false assumes you are in the United States
inputFieldIdstringAdd an id to the input field if provided.
intlCompIdstringThe id to add to the outermost div of the component.
defaultFocusboolIf true sets initial focus to the dropdown button.
i18nStringsobjectInternationalization strings to use the component in other languages.
countryCodeDataarrayThe data for the country code dropdown menu.
onIntlPhNoChangefuncFunction to be executed on changing the number in the input field.
onCountryCodeChangefuncFunction to be executed on changing the country code via the drop down.
onPhoneValidityCheckfuncFunction to be executed when checking the phone validity.
onBlurfuncFunction to be executed when an element loses focus.
onDeletefuncFunction to be executed when a field value is cleared using the delete button.
phoneRequiredboolIf true will show error if a phone is needed and none has been entered.
enableDeleteboolBoolean to enable the delete buttons on fields.
showDeleteIfEmptyboolBoolean to show delete buttons even if no fields exist.
focusInputOnInitboolIf true sets the initial focus to the input field.
validateOnInitboolIf true will run validation when page loads.
customValidatorsshapeAn array of validators that contains the validator and error message.
customValidators.validatorfuncCustom function for validating country code and phone number.
customValidators.errorMessagestringError message to display should validation fail.
ariaLabelForInputstringCustom accessibility label for the input.

iFrame for rendering content.

Example

show code

Props

NameRequiredTypeDescriptionDefault Value
cssIncludesarray of stringsArray of css files to include.
jsIncludesarray of stringsArray of js files to include.
resizerstringThe URL for an iFrame resizer.
resizerOptionsobjectOptions to modify the iFrame resizer.
labJSstringString for LAB.js URL.
dataobjectData to add to the iFrame window.
classNamestringString to add classname to the div containing the iFrame for styling purposes.
scrollingboolDefaults to true, if false will prevent scrolling in iFrames.
allowDomainsarray of stringsString array of allowable domains for the iFrame to use.
onLoadfuncCustom function to be executed when the iFrame loads.
titlestringString to add title attribute to the iFrame.

A switch that can be toggled on or off

Example

show code

Props

NameRequiredTypeDescriptionDefault Value
defaultActiveboolIf true defaults switch to active.
i18nStringsobjectInternationalization strings for displaying component in other languages.
isSmallboolif true, the toggle switch is small.
disabledboolIf true, the toggle switch is disabled.
onChangefuncFunction to be executed when toggle switch changes.

Scalable Vector Graphic component

Example

show code

Props

NameRequiredTypeDescriptionDefault Value
namestringName of the icon (examples: PageLoader, Delete, Info).
sizestringAdd string size of to the SVG container.
widthunionWidth of SVG container.
heightunionHeight of SVG container.
classNamestringCustom class name to add to the SVG container.
titlestringString for SVG title attribute to improve accessibility.
descstringString for SVG description attribute to improve accessibility.
styleobjectObject of CSS styles for SVG container.

This component is responsible for loading custom content. Different configurations are required as props depending on the integration type.

Example

show code

Props

NameRequiredTypeDescriptionDefault Value
configshapeThe configuration object for the custom component.
config.typeOne of: component, controlled-iframe, uncontrolled-iframe, Which of the 3 configurations for the custom component you will be using.
config.jsarray of stringsArray of filepath strings to js files that the developer wants to include.
config.cssarray of stringsArray of filepath strings to css files that the developer wants to include.
config.urlstringUrl to content the developer wants to use for the uncontrolled-iframe configuration.
config.componentNamestringThe name of the component as defined by JSON dot notation.
pageConfigsshapeThe page configuration object that loads scripting and styling scripts for the component.
pageConfigs.iframeSizerUrlstringUrl string to the iFrame Resizer.
pageConfigs.LABjsUrlstringUrl string to the iFrame Resizer.
allowDomainsarray of stringsThe allowable domains for the file to access.
languagestringThe current language.
isPageLevelboolIf true, makes the component use the whole page.
resourceLoadTimeoutnumberAdd a check interval timer to display error if request gets an unusable response.
enableIFrameScrollingboolBoolean to make the iFrame scrollable.
resourceVersionstringResource version to append to the static resource request.
iframeHeightnumberHeight parameter for the iFrame.
idstringAdd an id to the iFrame.
iframeIdstringUsed for determining if the id should be null or show the 'id'.
resizerOptionsobjectOptions to add to the iFrame resizer.
onIframeLoadfuncFunction to be executed when iFrame loads.
titlestringString to set title attribute of the iFrame.

This component serves as a container to allow content created by other frameworks (such as jQuery) to exist within the React component tree. This component should always be a leaf child node in the tree. It should never have React children since those React components would never update.

Example

show code

Props

NameRequiredTypeDescriptionDefault Value
idstringid attribute for the component for mounting and unmounting the component.
elementTypestringLists the type of element you are creating.Defaults Value: div
childrennodechildren of the component - this is what will be displayed inside the component.

Component to be shown when items are loading

Example

show code

Modal loading screen

Example

show code

Props

NameRequiredTypeDescriptionDefault Value
textstringText that will appear beneath the spinner.
containedboolWhen true, the modal will be rendered inside the node that contains it, otherwise the modal will be rendered directly into the body of the document.

Modal component that will attach itself to the document body.

Example

show code

Props

NameRequiredTypeDescriptionDefault Value
fullScreenboolIf true the modal will cover the full screen.
showboolIf false will prevent the modal from showing.
titlestringTitle to add in the modal layover - it will appear in the top left corner and as a h2 element.
closeButtonboolIf true will add a close button to the top right corner of the modal.
onClosefuncCustom function to be executed when the modal is closed.

Component to be shown whenever something is loading on a page

Example

show code

A split button component. The right side opens a dropdown, and the left side is a customizable button.

Example

show code

Props

NameRequiredTypeDescriptionDefault Value
buttonLabelstringString of text to add to left button.
variationTypeOne of 'primary', 'secondary', 'tertiary'Sets color of left button to dark grey(primary), light grey(secondary), or white(tertiary).primary
idstringString to set the id attribute for the div containing the split button.
listHeightnumberAdds a max height to the dropdown list in pixels.
itemWrapperfuncCustom function for wrapping each item in this.props.items.
itemsarrayArray of objects to be rendered in dropdown.
onButtonSelectfuncCustom function to be executed when the user click the left button.
onItemSelectfuncCustom function to be executed when an item is selected from the dropdown list.
menuExtendsOnRightboolIf true dropdown menu extends to the right.
menuExtendsOnLeftboolIf true dropdown menu extends to the left.