Introduction

FAQ

How do I run the styleguide locally?

How do I debug issues with the styleguide locally?

How do I add my component to the styleguide

  • add your new component to the sections in mono/es-react-components/config/sections.js

    • if your component has multiple files or it belongs in a new sections make sure to create a new section.
    • if your component has multiple files but some are private and should not be exposed, add the files you want to ignore to mono/es-react-components/config/ignore.
    • otherwise add your component in the Additional Components section.

reference https://react-styleguidist.js.org/docs/components.html#sections

How do I document my new react component?

  • add a readme.md to mono/es-react-components/src/<my new ui component>/
  • use markdown to document examples
  • props and default props will be automatically parsed from your component
  • add descriptions to your props by using JSDoc notations

reference https://react-styleguidist.js.org/docs/documenting.html

How do I document anything other than a react component?

  • add a <doc-name>.md to the mono/es-react-components/docs folder.

What if I need to use an external package as part of my component doc?

  • you can add the required package and map the function you need for the doc examples.

    • add the function and package path to the context property in styleguide.config.js

reference https://react-styleguidist.js.org/docs/configuration.html#context

What if I think the documentation is wrong, could be better, or missing?

  • grab a cup of coffee, relax and fix it ¯\_(ツ)_/¯

Design

Typology

@todo add typology doc

h1 example

title

paragraph

<h1>h1 title</h1>
<p>paragraph</p>

Buttons

ButtonDropDown

src/button-drop-down/button-drop-down.js

Uses all of the same properties available to a normal button.

Renders a button that summons a drop-down menu of actions when clicked. If a primary action is provided to this component, then a secondary button will be rendered to summon the drop-down menu, and the primary button will trigger the supplied primary action when clicked.

Prop nameTypeDefaultDescription
actionsshape[]undefined

An array of objects which represent the actions that can be taken in the drop-down

disabled: bool
label: stringRequired
onClick: func
buttonIconstringfasChevronDown

Overrides the default icon rendered on the underlying Button

childrennodeundefined

Overrides any actions array passed in and renders content inside the dropdown instead

containerClassNamesstringundefined

additional styles to be applied to the container element surrounding the ButtonDropDown itself

isRightAlignedboolfalse

Informs the button drop down that it is right-aligned, and should style itself accordingly.

primaryActionfuncundefined

If this onClick handler is defined, the drop-down will be rendered as a split-button. Otherwise, the entire button will summon the actions drop-down.

Basic Button Drop Down Example:

Basic Button Drop Down Example With Custom Icon:

Custom Menu Content Example:

Split Button Drop Down Example:

Split Button Drop Down with Custom Menu Example:

ButtonGroup

src/button-group/button-group.js
Prop nameTypeDefaultDescription
childrennodeRequired
classNamestringnull

class name for overriding button group styles at implementation

collapsedboolfalse

removes padding between the buttons

inlineboolfalse

displays the buttons inline instead of vertical

inlineRightboolfalse

displays the buttons inline, right justified

responsiveboolfalse

displays the buttons inline with responsive wrapping

rightboolfalse

displays the buttons right justified

topMarginstringnull

takes a number+unit to add a top margin as an inline style

Button Group Example:

Inline Button Group:

Inline Button Group:

Responsive Button Group:

Collapsed Button Group:

Collapsed Inline Button Group:

Button

src/button/button.js
Prop nameTypeDefaultDescription
blockboolnull

applies 100% width to the button

buttonClassNamestringnull

Button class name to override styles at implementation

buttonTypeenumnull

Button type

One of: primary, positive, negative, warning, link, transparent, outline
childrenanynull

child nodes allow for custom content to go inside of the button, overrides all other values like icons and labels

disabledboolfalse

disabled

iconstringnull

icon from our Icon component

iconClassstringnull

icon class for example fa fa-plus

iconPropsobjectShape

props to be applied to the underlying icon

inverseboolfalse

Swaps the background and text colors of the button

labelstring

button label

largeboolfalse

larger button

onClickfuncnull

button click event

rightIconboolfalse

when icon or iconClass is provided rightIcon will place the icon on the right

smallboolfalse

smaller button

stylesstringnull

DEPRECATED: Please use buttonClassName to override styles

submitTypeboolfalse

type="submit"

uppercaseboolfalse

uppercase label

Button Types:

Inverse Buttons:

With an Icon:

Custom Button children:

Block button:

Disabled button:

Small button:

Large button:

Custom Styles:

RouterLinks

Tabs

Tab

src/tabs/tab.js
Prop nameTypeDefaultDescription
childrennodenull
classNamestringnull

custom class

disabledboolfalse

whether the tab is disabled or not

idstringnull

the id of the tab, used in the selected in the parent Tab component

noPaddingboolfalse

disables padding for the tab

scrollingboolfalse
titleunionnull

the title of the tab, this is displayed int eh tab menu

One of type: node, string

Basic Tab:

Some content

Disabled Tab

Some content

Icon Title

Some content

Tabs

src/tabs/tabs.js
Prop nameTypeDefaultDescription
childrenunion[]null

accepts an array of Tab-like elements

classNamestringnull

custom class

defaultTabunion0

the initial tab to show

One of type: number, string
onChangefuncnull

called when the tabs change

onSelectfuncnull

called before the tabs are changed, if false is returned it will cancel the change

orientationenumhorizontal

"vertical" or "horizontal" (default) show the tabs above the content or to the left of the content

One of: horizontal, vertical
responsiveboolfalse

forces the tabs to fill up the entire space available

selectedunionnull

the currently selected tab

One of type: number, string
withDividerboolfalse

Basic Example:

content 1

Sticky Tab Header:

Ignore the squirrels, you'll never catch them anyway going to catch the red dot today going to catch the red dot today spread kitty litter all over house sniff other cat's butt and hang jaw half open thereafter for cat mojo who's the baby, so be superior. Hack up furballs mrow claw drapes, yet reward the chosen human with a slow blink but get video posted to internet for chasing red dot for trip on catnip. Kitty power love blinks and purr purr purr purr yawn stare at ceiling somehow manage to catch a bird but have no idea what to do next, so play with it until it dies of shock what a cat-ass-trophy!. Eat a rug and furry furry hairs everywhere oh no human coming lie on counter don't get off counter cough for find a way to fit in tiny box. Licks paws chase dog then run away cough furball into food bowl then scratch owner for a new one. Stare at ceiling. Hiiiiiiiiii feed me now cats go for world domination or i cry and cry and cry unless you pet me, and then maybe i cry just for fun for eat the fat cats food man running from cops stops to pet cats, goes to jail. Lick plastic bags. Lick yarn hanging out of own butt playing with balls of wool hiiiiiiiiii feed me now chase after silly colored fish toys around the house but claw your carpet in places everyone can see - why hide my amazing artistic clawing skills? mrow stinky cat. My cat stared at me he was sipping his tea, too i just saw other cats inside the house and nobody ask me before using my litter box all of a sudden cat goes crazy claw drapes, or refuse to come home when humans are going to bed; stay out all night then yowl like i am dying at 4am yet small kitty warm kitty little balls of fur. Eat and than sleep on your face step on your keyboard while you're gaming and then turn in a circle . Grab pompom in mouth and put in water dish white cat sleeps on a black shirt. Instead of drinking water from the cat bowl, make sure to steal water from the toilet proudly present butt to human. Purrrrrr purr when being pet but hack up furballs so attack dog, run away and pretend to be victim for meowing chowing and wowing or sniff all the things meow meow, i tell my human. Chase the pig around the house try to jump onto window and fall while scratching at wall eat grass, throw it back up yet grab pompom in mouth and put in water dish experiences short bursts of poo-phoria after going to the loo. Purr while eating love you, then bite you. Sniff sniff. Sleep scoot butt on the rug. Experiences short bursts of poo-phoria after going to the loo. I like frogs and 0 gravity jump around on couch, meow constantly until given food, purr for find empty spot in cupboard and sleep all day. The fat cat sat on the mat bat away with paws jumps off balcony gives owner dead mouse at present then poops in litter box snatches yarn and fights with dog cat chases laser then plays in grass finds tiny spot in cupboard and sleeps all day jumps in bathtub and meows when owner fills food dish the cat knocks over the food dish cat slides down the water slide and into pool and swims even though it does not like water, attack feet, wake up human for food at 4am chill on the couch table annoy the old grumpy cat, start a fight and then retreat to wash when i lose. Find something else more interesting the cat was chasing the mouse spot something, big eyes, big eyes, crouch, shake butt, prepare to pounce yet chew the plant roll on the floor purring your whiskers off so spread kitty litter all over house disappear for four days and return home with an expensive injury; bite the vet. Cats making all the muffins love blinks and purr purr purr purr yawn grab pompom in mouth and put in water dish or slap owner's face at 5am until human fills food dish, but cats making all the muffins poop in a handbag look delicious and drink the soapy mopping up water then puke giant foamy fur-balls. Stare at the wall, play with food and get confused by dust rub face on everything. Cat dog hate mouse eat string barf pillow no baths hate everything instead of drinking water from the cat bowl, make sure to steal water from the toilet or eat plants, meow, and throw up because i ate plants the dog smells bad find something else more interesting headbutt owner's knee for need to check on human, have not seen in an hour might be dead oh look, human is alive, hiss at human, feed me. Ooh, are those your $250 dollar sandals? lemme use that as my litter box i cry and cry and cry unless you pet me, and then maybe i cry just for fun. Poop on grasses. Hate dog loved it, hated it, loved it, hated it disappear for four days and return home with an expensive injury; bite the vet. Why use post when this sofa is here. Leave hair on owner's clothes. Give me some of your food give me some of your food give me some of your food meh, i don't want it when in doubt, wash stare at ceiling light lick sellotape and lick the curtain just to be annoying crash against wall but walk away like nothing happened. Hiding behind the couch until lured out by a feathery toy love me! so spill litter box, scratch at owner, destroy all furniture, especially couch so play riveting piece on synthesizer keyboard or put butt in owner's face, or you call this cat food. Wake up human for food at 4am jump five feet high and sideways when a shadow moves kitty kitty for demand to be let outside at once, and expect owner to wait for me as i think about it or hack ask to go outside and ask to come inside and ask to go outside and ask to come inside, eat the fat cats food. Sniff other cat's butt and hang jaw half open thereafter crash against wall but walk away like nothing happened, hit you unexpectedly poop on floor and watch human clean up love and coo around boyfriend who purrs and makes the perfect moonlight eyes so i can purr and swat the glittery gleaming yarn to him (the yarn is from a $125 sweater) pee in the shoe yet the cat was chasing the mouse. Hopped up on catnip wack the mini furry mouse sit on human lick the plastic bag bird bird bird bird bird bird human why take bird out i could have eaten that for friends are not food. Murf pratt ungow ungow cry louder at reflection yet pose purrfectly to show my beauty make muffins, for dismember a mouse and then regurgitate parts of it on the family room floor.

Vertical Tabs:

content 1

Responsive Vertical Tabs:

Ignore the squirrels, you'll never catch them anyway going to catch the red dot today going to catch the red dot today spread kitty litter all over house sniff other cat's butt and hang jaw half open thereafter for cat mojo who's the baby, so be superior. Hack up furballs mrow claw drapes, yet reward the chosen human with a slow blink but get video posted to internet for chasing red dot for trip on catnip. Kitty power love blinks and purr purr purr purr yawn stare at ceiling somehow manage to catch a bird but have no idea what to do next, so play with it until it dies of shock what a cat-ass-trophy!. Eat a rug and furry furry hairs everywhere oh no human coming lie on counter don't get off counter cough for find a way to fit in tiny box. Licks paws chase dog then run away cough furball into food bowl then scratch owner for a new one.

Controlled Tabs

Tab component

content 1

Steps

Steps

src/steps/steps.js
Prop nameTypeDefaultDescription
childrenanyRequired

The children to be rendered inside the Steps container

classNamestringundefined

A classname that is applied to the outer container of the steps component

currentnumber0

The current step number

directionenumhorizontal

Specify the direction of the steps

One of: horizontal, vertical
iconsshapeundefined

Override icons that can be used if passed in for the finish and error icons

finish: enum
error: enum
initialnumber0

The initial step number

labelPlacementenumhorizontal

Direction of the label placements

One of: horizontal, vertical
sizeenumnormal

The size of the Steps component as a string

One of: normal, large, small
statusenumprocess

The default status used in child steps

One of: wait, process, error, finish
styleobjectShape

Additional styles that can get directly applied to the outer container

Steps example:

Finished
This is a description.
2
In Progress
This is a description.
3
Waiting
This is a description.

Small Size example:

Finished
This is a description.
2
In Progress
This is a description.
3
Waiting
This is a description.

Larger Size example:

Open
This is a description.
Closed
This is a description.
Billed
This is a description.

Vertical Label example:

Finished
This is a description.
2
In Progress
This is a description.
3
Waiting
This is a description.

Small Size Vertical Labels example:

Open
Closed
Billed

Larger Size Vertical Labels example:

Open
Closed
Billed

Icon example:

Login
Verification
Pay
Done

Custom Finish/Error Icon example:

Login
Verification
Pay
Done

Controlled Steps

1
First
2
Second
3
Last
First-content

Vertical:

Finished
This is a description.
2
In Progress
This is a description.
3
Waiting
This is a description.

Status:

Finished
This is a description
In Process
This process had an error
3
Waiting
This is a description

Step

src/steps/components/step.js
Prop nameTypeDefaultDescription
classNamestring

Do not modify, applied from the parent Steps component: A class applied to the Step container

descriptionanyundefined

The text description for the Step

iconenumundefined

Icon string used, must be one of the imported FontAwesome 5 found in the icon-config.js

Object.keys( iconList )
iconsshapeundefined

Used when the icons for "finish" or "error" states need to be overridden on a single step

finish: enum
error: enum
itemWidthunionundefined

Do not modify, applied from the parent Steps component: Override for the width of the step

One of type: number, string
statusenumundefined

The status used for the Step, "wait", "process", "error", "finish"

One of: wait, process, error, finish
stepNumbernumberundefined

Do not modify, applied from the parent Steps component: The step number, applied by the outer Steps container

styleobjectundefined

Do not modify, applied from the parent Steps component: Additional styles that can get directly applied to the Step outer container

titleunionundefined

The title of the Step, can be a string or node such as a Button

One of type: node, string

Form Controls

Autocomplete

src/form-controls/autocomplete/autocomplete.js
Prop nameTypeDefaultDescription
autoFocusboolnull

auto focus

classNamestringnull

component classname

clearablebooltrue
disableFilteringboolfalse

whether to disable option filtering

disabledboolfalse

disabled state, see Input

filterOptionfuncnull

a custom filter method

idanynull

the id of the html input

isLoadingboolfalse

enables or disables the loading state of the input

labelstringnull

a label for the input, see Input

labelKeystringlabel

a string for getting an options label

loadOptionsfuncnull

a function that is called to load options

loadingTextstringLoading...

custom text to show when the input is in loading state

maxHeightnumber250
menuDetachedboolfalse

detaches the menu (set true when in places like modals)

namestringnull

the name of the input

noResultsTextstringNo results found

custom text to show when there is no options that match

onBlurfuncnull
onChangefuncnull

called when the user selects an option

onFocusfuncnull
onInputChangefuncnull

called when the input changes

optionHeightnumber35

explicit height of menu option

optionRendererfuncnull

a function that is used to render the contents of an option in the option menu

optionsshape[][]

an array of options

disabled: boolwhether the option is disabled
placeholderstringSelect...

the placeholder text to show when no value is selected

requiredboolfalse

required state, see Input

valueunionnull

the value of the input

One of type: bool, number, string, union[]
valueKeystringvalue

a string used to get the value of an option

valueRendererfuncundefined

a function that is used to render the selected value

multiboolfalse
removeSelectedbooltrue
simpleValuebooltrue
delimiterstring,
This is some placeholder text

Autocomplete With Options

Select...

Disabled Autocomplete

Select...

Not clearable Autocomplete

option

Controlled Autocomplete

react
{"label":"React","value":"react"}
React

Autocomplete in Modal

Creating an async Autocomplete input

Select...

Custom Option Content

Select...

Custom Option AND "value" content

🔥 Hot 🔥

Multi-select simpleValue=true

"react,ember"
[]
React
Ember

Multi-select simpleValue=false

[1,"ember"]
[]
React
Ember

Custom filtered options (only filters by value and not label)

react
{"label":"React","someValue":"react"}
React

Disabled filtering options

react
{"label":"React","value":"react"}
React

Required Autocomplete


null
Select...

Required Multi Autocomplete

[]
[]
Select...

Autocomplete With A Metric Butt Ton of Options

Select...

Checkbox

src/form-controls/checkbox/checkbox.js

Controlled Checkbox: the parent controls the checked state, and passes in an onChange method, if desired.

Controlled components are preferred by React so, <Checkbox/> would be used in the majority of cases where a checkbox is needed. <UncontrolledCheckbox/> can be used in cases where something closer to a native checkbox is a better choice.

Prop nameTypeDefaultDescription
checkedboolfalse

toggling checked/unchecked is handled by the parent

classNamestringnull

custom class name used to overwrite checkbox styles

disabledboolfalse

sets the disabled attribute

labelTextnodenull

checkbox label

namestringnull

name attribute, can be used to create a checkbox group

onChangefuncnull

Checkbox change event

onClickfuncnull

Checkbox click event, used to toggle parent's checked state

partiallyCheckedboolfalse

toggles partially checked state

requiredboolfalse

applies a "required" label, consumer must enforce required behavior

requiredMsgstringnull

replaces the default "required" label with a custom message

uppercaseboolfalse

uppercase label

valueunion

value attribute

One of type: string, number

Controlled Checkbox

Disabled:

With label text:

Required with label text:

Required with custom required message:

Checkbox with onChange:

Click count: 0

UncontrolledCheckbox

src/form-controls/checkbox/uncontrolled/uncontrolled-checkbox.js

Uncontrolled Checkbox: behaves like a native checkbox, with the parent having no control beyond adding custom onChange behavior.

Controlled components are prefered by React so, <Checkbox/> would be used in the majority of cases where a checkbox is needed. <UncontrolledCheckbox/> can be used in cases where something closer to a native checkbox is a better choice.

Prop nameTypeDefaultDescription
classNamestringnull

custom class name used to oevrwrite checkbox styles

defaultCheckedboolfalse

defaults the checked state to true

disabledboolfalse

sets the disabled attribute, defaults to false

labelTextstringnull

checkbox label

namestringnull

name attribute, can be used to create a checkbox group

onChangefuncFunction

Checkbox change event - can be used to trigger behavior after a click

requiredboolfalse

makes the Checkbox required

requiredMsgstringnull

adds a required message

uppercaseboolfalse

uppercase label

Default checked:

Disabled:

With label text:

Required with label text:

Required with custom required message:

With custom onChange behavior:

ColorPicker

src/form-controls/colorpicker/colorpicker.js
Prop nameTypeDefaultDescription
colorsarray[ "#4e4e4e", "#909194", "#cfcfd1", "#2ab6ea", "#094874", "#46294e", "#7e2779", "#ed3895", "#f6911e", "#fcb22e", "#9dcc45", "#60aa45", "#3b6731" ]

Array of color values

handleChangefuncFunction

Callback when a color is selected

selectedColorstringnull

Currently selected color, defaults to first color in colors

sortboolfalse

Sort colors based on hue

ColorPicker:

ColorPicker with Sorted Colors:

Input

src/form-controls/input/input.js
Prop nameTypeDefaultDescription
autocompletestringoff
autofocusboolfalse
classNamestring

custom class

disabledboolfalse

disabled boolean

iconClickHandlerunionnull

set icon click handler only if iconName is provided

One of type: func, null
iconNamestring

icon name for example fa fa-paperclip

idstring

input id attribute. If not set a random id will be assigned with the prefix input

labelstring

label for the input

maxLengthnumbernull

maximum character limit

namestring

name attribute

onChangefuncnull

onChange event handler

onKeyDownfuncFunction

onKeyDown event handler

onKeyUpfuncFunction

onKeyUp event handler

placeholderstring
readonlyboolfalse

mark the input as readonly

requiredboolfalse

mark the input as required

stepnumbernull
swapLabelboolfalse

creates placeholder -> label swap behavior - requires placeholder value

typestringtext

input type for example "text", "number", "email" etc.

valueunion

inital value

One of type: string, number

Input example:

Input with label:

Input with icon:

Required input:

Input with button:

File Input example:

QrReader

src/form-controls/qr-reader/qr-reader.js
Prop nameTypeDefaultDescription
disabledboolfalse

mark the input as disabled

onChangefuncFunction

onChange event handler

onErrorfuncFunction

error handler

readonlyboolfalse

mark the input as readonly

textValuestring

value to set for the text input

QR Reader Example:

RadioButton

src/form-controls/radio-group/radio-button.js
Prop nameTypeDefaultDescription
classNamestring

custom class

idstring

an id for the button (optional)

labelstring

text for the radio button label

onChangefuncFunction

onChange event handler

selectedboolfalse

is this button selected or not

valueunionRequired

value to be used for the radio button

One of type: string, number, bool
labelClassNameunknown

RadioGroup

src/form-controls/radio-group/radio-group.js
Prop nameTypeDefaultDescription
classNamestring

custom class

onChangefuncFunction

onChange event handler

radioOptionsarrayRequired

array of objects to be rendered for each radio button

selectedValueunionnull

any preselected value to be rendered by default

One of type: string, number, bool

RadioGroup example:

SelectDropDown

src/form-controls/select-dropdown/select-dropdown.js
Prop nameTypeDefaultDescription
childrenunionRequired
One of type: element, node, array
classNamestring
disabledboolfalse
iconClickHandlerunionnull
One of type: func, null
iconNamestringnull
idstringnull
labelstringnull
namestringnull
onChangefuncFunction
placeholderstringnull
requiredboolfalse
valueunionnull
One of type: string, number

Select dropdown with no default value

Select dropdown with an icon

Synced Select dropdowns

Select 1

Select 2

StrictCurrencyInput

src/form-controls/strict-currency-input/strict-currency-input.js

Any props passed in will get passed down into the Input component, the only prop that gets modified is onChange

Prop nameTypeDefaultDescription
localeCodestringen-US

locale code to base currency icon and conversion from

onChangefuncRequired

onChange event handler

valuestring

value for input

StrictCurrencyInput example:

Working Example:

StrictDecimalInput

src/form-controls/strict-decimal-input/strict-decimal-input.js

Any props passed in will get passed down into the Input component, the only prop that gets modified is onChange

Prop nameTypeDefaultDescription
accuracynumber2

Determines accuracy of decimal numbers *

onChangefuncRequired

onChange event handler

StrictDecimalInput example:

Required input:

StrictNumberInput

src/form-controls/strict-number-input/strict-number-input.js

Any props passed in will get passed down into the Input component, the only prop that gets modified is onChange

Prop nameTypeDefaultDescription
onChangefuncRequired

onChange event handler

StrictNumberInput example:

Required input:

TextArea

src/form-controls/textarea/textarea.js
Prop nameTypeDefaultDescription
autocompletestringnull
autofocusboolfalse
classNamestring

custom class

colsnumber
iconClickHandlerunionnull

set icon click handler only if iconName is provided

One of type: func, null
iconNamestringnull

icon name for example fa fa-paperclip

idstringnull

input id attribute. If not set a random id will be assigned with the prefix input

labelstringnull

label for the input

namestringnull

name attribute

onChangefuncnull

onChange event handler

placeholderstring

any placeholder text for the textarea

requiredboolfalse

mark the textarea as required

resizeenumvertical
One of: none, both, vertical, horizontal
rowsnumber

the number of rows the textarea should have

valueunion
One of type: string, number
wrapboolfalse

Should the textarea contain the text without scrolling horizontally

Setting textarea height

Setting wrap on the text area

Controlled textarea

Value: controlled textarea

Progress

Progress

src/progress/progress.js
Prop nameTypeDefaultDescription
classNamestringundefined

additional classes applied to the progress bar

labelOverridefuncundefined

a function that accepts two arguments: progressType and percent and returns a JSX node or string

percentunion0

How much of the progress is filled in

One of type: number, string
progressTypeenumundefined

the type of progress bar to use and any associated icons

One of: normal, exception, success
showInfobooltrue

should the info be displayed next to the bar

smallboolfalse

renders the bar in a smaller height

strokeColorstringundefined

color of progress bar

strokeLinecapenumround

type of end used for the filled in progress

One of: round, square
strokeWidthunionundefined

How thick the progress bar is in pixels

One of type: number, string

Progress Bars example:

10%

Small Progress Bars example:

10%

Basic Controlled Example:

12%
12%

Custom Label example:

10 of 100

Circle

src/progress/circle/circle.js
Prop nameTypeDefaultDescription
classNamestringundefined

additional classes applied to the progress bar

gapDegreenumber0

How of a gap is rendered, 0 - 360

gapPositionenumbottom

The position of the gap in the circle

One of: top, bottom, left, right
labelOverridefuncundefined

a function that accepts two arguments: status and percent and returns a JSX node or string

percentunion0

How much of the progress is filled in

One of type: number, string
progressTypeenumundefined

the type of progress bar to use and any associated icons

One of: normal, exception, success
showInfobooltrue

should the info be displayed inside the circle

strokeColorstringundefined

color of progress bar

strokeLinecapenumround

type of end used for the filled in progress

One of: butt, round, square
strokeWidthunionundefined

How thick the progress bar is in pixels

One of type: number, string
trailColorstring#f3f3f3

color of the unfilled progress bar

widthnumberundefined

width of the progress circle

Circle examples:

75%

Basic Controlled Example:

12%

Dashboard

src/progress/dashboard/dashboard.js
Prop nameTypeDefaultDescription
gapDegreenumber75

An integer value for how much space the dashboard covers

gapPositionenumbottom

the gap position, options: top right bottom left

One of: top, right, bottom, left

Dashboard examples:

15%

Gap Position examples:

15%

Gap Degree examples:

15%

Basic Controlled Example:

12%

Tables

VirtualizedTableForm

src/virtualized-table-form/virtualized-table-form.js

Handles use-case when the user needs to take action on a combination of rows/columns (not be intended for simple table views). Active development will occur with an eye towards the Design System’s new direction. Future roadmap for this component will be breaking it apart into smaller, composable components (ex: form actions vs virtualized table) so the internal implementation can be replaced.

Renders a table with a fixed header and (optionally) fixed columns, based on the MultiGrid component from react-virtualized. Unless otherwise noted the properties available to MultiGrid and Grid will be directly applied, as-is.

The table will stretch to fill all available space within its container. If the table overflows the width of its container, the user may scroll horizontally to view overflowed content. Optionally, you may choose to fix one or more columns in place, so that they do not scroll horizontally with the rest of the table.

Notes:

  • The preferred implementation is to abstract the columns out of the table declaration file and into a ./columns/ subdirectory. Examine the code for the "ESVirtualizedTable with Abstracted Columns" below. Currently, a real-life example can be found at es-track/manage/js/components/asset-keypad-table/.
  • If the UI design calls for a highly customized layout for the record, you can create custom records. See the code for "VirtualizedTableForm with Custom Record Component" for an example. Because sorting and filtering could return unexpected results on a column of custom records, consider adding a custom header and search component.
  • You can create a custom header. See the code for "VirtualizedTableForm with Custom Header" for an example.

Ignored MultiGrid and Grid Properties

  • cellRenderer
  • classNameBottomLeftGrid
  • classNameBottomRightGrid
  • classNameTopLeftGrid
  • classNameTopRightGrid
  • columnCount
  • enableFixedColumnScroll
  • enableFixedRowScroll
  • estimatedColumnSize
  • estimatedRowSize
  • fixedRowCount
  • height
  • noContentRenderer
  • rowCount
  • scrollToRow
  • width
Prop nameTypeDefaultDescription
buttonsarray[]

An ordered array of Buttons to be displayed in the upper right button group. Note: You must specify the key attribute of each button in the array.

columnsshape[]Required

An array of column configurations

key: stringRequired
title: stringRequired
className: string
customFilter: func
customHeader: func
customSortComparer: func
defaultSort: bool
defaultSortDirection: string
excludeFromExport: bool
exportData: func
filterable: bool
filterData: func
filterSortData: func
hideTooltip: bool
minWidth: number
render: func
rightAligned: bool
sortable: bool
sortData: func
tooltip: func
width: number
columnsButtonelement<Button label="Columns" />

Button used to toggle multi-select curtain to show and hide table columns. *

csvExportTypeenumbasic

Providing the basic type will display a basic export button when csv export is enabled. Providing the advanced type will display an export button with expanded options for exporting. Note: If ESVirtualizedTable.filterable == true then the advanced button will display. This is to maintain backwards compatibility for now.

One of: advanced, basic
csvFileNamestringexport

The base file name (excluding file extension) that will be used when exporting to a CSV file.

customHeaderHeightnumbernull

A fixed height applied to each column header.

defaultFilterStateobjectShape

Applies a default filter to the table as it renders for the first time. Multiple columns can be filtered. Expected format is: { one_column_key: "on filter", two_column_key: "two filter" }

defaultMinColumnWidthnumber150

Applies a minimum width to columns that don't define their own minimum width.

defaultSortStateobjectShape

Applies default sort to the table as it renders for the first time. This will override the sorting from the Column definition. Expected format is: { column_key: "ASC" } { column_key: "DESC" }

disableRowHoverHighlightingboolfalse

Turns off row highlighting on hover for performance

emptyStateTextstringNo Data

Text to display if no data is available to the table

enableCsvExportboolfalse

Set to true to enable an "Export to CSV" button for the table

filterablebooltrue

Set to false to disable filtering of the entire table.

fixedColumnCountnumber0

The number of columns (from the left edge of the table) to fix in place if horizontal scrolling becomes necessary to view table content.

onCellClickfuncFunction

The callback to invoke whenever a cell in the table is clicked. The callback is invoked with the row item and column configuration associated with the clicked cell.

onSectionRenderedfuncundefined

A passthrough to Grid's onSectionRendered

onStateEventfuncFunction

The callback to invoke whenever a state event is broadcasted. The callback is invoked with the name of the event and the new state values. State events setup for broadcast: "filterChange" "sortChange"

renderCustomExportButtonfuncundefined

Renders a custom csv export button. Expects the following argument: { exportAllCsv } or, if allowing a filtered export { exportAllCsv, disableFilteredExport, exportFilteredCsv }

rowClassNamefuncFunction

Takes a row object and returns a string that will be applied to the cells within the associated row

rowHeightnumber45

A fixed height applied to each row.

rowsarrayRequired

An array of row objects.

Column Properties

PropertyTypeRequired?DefaultDescription
keyStringA unique string used to identify the column. This string should correspond to a key within your row objects.
titleStringThe title of the column to be displayed for the user.
classNameStringAn optional class name that will be applied to the content of each table cell in this column.
customFilterFunctionGiven a filter term (string) and a row object, returns a boolean for use with Array.prototype.filter
customHeaderFunctionAdd a custom header component when the UI design requires functionality/layout beyond that which the default header can provide
customSortComparerFunctionGiven a sort direction ("ASC" or "DESC") and rows a and b, returns a number for use with Array.prototype.sort
defaultSortBooleanfalseSet to true if this column should be sorted by default. (Only one column should have this property set to true)
defaultSortDirectionStringDESCMust have defaultSort set to true, and be a value of "DESC" or "ASC", if not included or an invalid type will default to "DESC"
excludeFromExportBooleanfalseSet to true to exclude the column from CSV export.
exportDataFunctionGiven a row object, returns data that will be used when exporting table to a CSV file.
filterableBooleantrueSet to false to disable filtering for the column.
filterDataFunctionGiven a row object, returns data that will be used to filter the column. Unlike sortData and filterSortData, this can return an array of values. Overrides filterSortData.
filterSortDataFunctionGiven a row object, returns data that will be used to sort and filter the column.
hideTooltipBooleanfalseSet to true to hide the tooltip for the column.
minWidthNumberOverrides the default minimum column width applied by the table.
renderFunctionGiven a row object, returns renderable content to display within the cell.
rightAlignedBooleanfalseRight aligns the column contents
sortableBooleantrueSet to false to disable sorting for the column.
sortDataFunctionGiven a row object, returns data that will be used to sort the column. Overrides filterSortData.
tooltipFunctionGiven a row object, returns string of text to display as the cell's tooltip.
widthNumberSets a fixed width for the column. Overrides all other width properties.

VirtualizedTableForm Basic Example:

ID
Name
Year
9
test9
2020
8
test8
2019
7
test7
2019
6
test6
2018
5
test5
2018
4
test4
2017
3
test3
2017
2
test2
2016
1
test1
2016

VirtualizedTableForm Fixed Columns Example (with year column right aligned):

ID
Name
Year
9
8
7
6
5
4
3
2
1
test9
2016
test8
2016
test7
2016
test6
2016
test5
2016
test4
2016
test3
2016
test2
2016
test1
2016

VirtualizedTableForm CSV Export Example:

ID
Name
Year
9
test9
2019
8
test8
2018
7
test7
2018
6
test6
2017
5
test5
2017
4
test4
2016
3
test3
2016
2
test2
2015
1
test1
2015

VirtualizedTableForm Advanced CSV Export Example:

ID
Name
Year
9
test9
2019
8
test8
2018
7
test7
2018
6
test6
2017
5
test5
2017
4
test4
2016
3
test3
2016
2
test2
2015
1
test1
2015

VirtualizedTableForm Empty Example:

ID
Name
Year
No Data

VirtualizedTableForm with Abstracted Columns:

Id
Name
Year
9
test9
2016
8
test8
2016
7
test7
2016
6
test6
2016
5
test5
2016
4
test4
2016
3
test3
2016
2
test2
2016
1
test1
2016

VirtualizedTableForm with Custom Record Component:

Custom Title
Asset Id: 1
  • Name: test1
  • Year: 2016
Asset Id: 2
  • Name: test2
  • Year: 2015
Asset Id: 3
  • Name: test3
  • Year: 2014
Asset Id: 4
  • Name: test4
  • Year: 2013
Asset Id: 5
  • Name: test5
  • Year: 2012
Asset Id: 6
  • Name: test6
  • Year: 2011
Asset Id: 7
  • Name: test7
  • Year: 2010
Asset Id: 8
  • Name: test8
  • Year: 2009
Asset Id: 9
  • Name: test9
  • Year: 2008

VirtualizedTableForm with Custom Header:

Custom Header Title
"I could be a custom search bar that knows how to filter and search on your custom record component!"
Asset Id: 1
  • Name: test1
  • Year: 2016
Asset Id: 2
  • Name: test2
  • Year: 2015
Asset Id: 3
  • Name: test3
  • Year: 2014
Asset Id: 4
  • Name: test4
  • Year: 2013
Asset Id: 5
  • Name: test5
  • Year: 2012
Asset Id: 6
  • Name: test6
  • Year: 2011
Asset Id: 7
  • Name: test7
  • Year: 2010
Asset Id: 8
  • Name: test8
  • Year: 2009
Asset Id: 9
  • Name: test9
  • Year: 2008

DEPRECATED_ESVirtualizedTable

src/DEPRECATED-es-virtualized-table/es-virtualized-table.js

DEPRECATED COMPONENT - UNSAFE TO USE

No new development will occur on this component. Defect resolution will continue until new components are available for migration, at which point full removal will be scheduled.

  • If you need virtualization and user actions on data (export, email, etc.) migrate to VirtualizedTableForm (also contained in this repo).
  • If you need a simple, styled table without virtualization, the Design System will be releasing a styled table suitable for migration. In the meantime, you can continue using the existing ESVirtualizedTable (not recommended) or work with the Design System team at creating a simple, styled table suitable to promotion into the new component library (recommended).
  • If you need a virtualized table with virtualization and without user actions on data, you can continue using the existing ESVirtualizedTable (not recommended) or break apart the virtualized table from the form components in VirtualizedTableForm (recommended).

The decision to deprecate this component was made by the F.E. Guild, on 07/30/2020. Please see https://www.notion.so/equipmentshare/Meeting-Doc-Thurs-07-30-20-1pm-8a5375a48e99412fb3be02f4f5331f73 (which is the notes from that day’s guild meeting) for more details.


Renders a table with a fixed header and (optionally) fixed columns, based on the MultiGrid component from react-virtualized. Unless otherwise noted the properties available to MultiGrid and Grid will be directly applied, as-is.

The table will stretch to fill all available space within its container. If the table overflows the width of its container, the user may scroll horizontally to view overflowed content. Optionally, you may choose to fix one or more columns in place, so that they do not scroll horizontally with the rest of the table.

Notes:

  • The preferred implementation is to abstract the columns out of the table declaration file and into a ./columns/ subdirectory. Examine the code for the "ESVirtualizedTable with Abstracted Columns" below. Currently, a real-life example can be found at es-track/manage/js/components/asset-keypad-table/.
  • If the UI design calls for a highly customized layout for the record, you can create custom records. See the code for "ESVirtualizedTable with Custom Record Component" for an example. Because sorting and filtering could return unexpected results on a column of custom records, consider adding a custom header and search component.
  • You can create a custom header. See the code for "ESVirtualizedTable with Custom Header" for an example.

Ignored MultiGrid and Grid Properties

  • cellRenderer
  • classNameBottomLeftGrid
  • classNameBottomRightGrid
  • classNameTopLeftGrid
  • classNameTopRightGrid
  • columnCount
  • enableFixedColumnScroll
  • enableFixedRowScroll
  • estimatedColumnSize
  • estimatedRowSize
  • fixedRowCount
  • height
  • noContentRenderer
  • rowCount
  • scrollToRow
  • width
Prop nameTypeDefaultDescription
buttonsarray[]

An ordered array of Buttons to be displayed in the upper right button group. Note: You must specify the key attribute of each button in the array.

classNamestringundefined
columnsshape[]Required

An array of column configurations

key: stringRequired
title: stringRequired
className: string
customFilter: func
customHeader: func
customSortComparer: func
defaultSort: bool
defaultSortDirection: string
excludeFromExport: bool
exportData: func
filterable: bool
filterData: func
filterSortData: func
hideTooltip: bool
minWidth: number
render: func
rightAligned: bool
sortable: bool
sortData: func
tooltip: func
width: number
csvExportTypeenumbasic

Providing the basic type will display a basic export button when csv export is enabled. Providing the advanced type will display an export button with expanded options for exporting. Note: If ESVirtualizedTable.filterable == true then the advanced button will display. This is to maintain backwards compatibility for now.

One of: advanced, basic
csvFileNamestringexport

The base file name (excluding file extension) that will be used when exporting to a CSV file.

customHeaderHeightnumbernull

A fixed height applied to each column header.

defaultFilterStateobjectShape

Applies a default filter to the table as it renders for the first time. Multiple columns can be filtered. Expected format is: { one_column_key: "on filter", two_column_key: "two filter" }

defaultMinColumnWidthnumber150

Applies a minimum width to columns that don't define their own minimum width.

defaultSortStateobjectShape

Applies default sort to the table as it renders for the first time. This will override the sorting from the Column definition. Expected format is: { column_key: "ASC" } { column_key: "DESC" }

emptyStateTextstringNo Data

Text to display if no data is available to the table

enableCsvExportboolfalse

Set to true to enable an "Export to CSV" button for the table

filterablebooltrue

Set to false to disable filtering of the entire table.

fixedColumnCountnumber0

The number of columns (from the left edge of the table) to fix in place if horizontal scrolling becomes necessary to view table content.

onCellClickfuncFunction

The callback to invoke whenever a cell in the table is clicked. The callback is invoked with the row item and column configuration associated with the clicked cell.

onHoverRowHighlightingbooltrue
onSectionRenderedfuncundefined

A passthrough to Grid's onSectionRendered

onStateEventfuncFunction

The callback to invoke whenever a state event is broadcasted. The callback is invoked with the name of the event and the new state values. State events setup for broadcast: "filterChange" "sortChange"

renderCustomExportButtonfuncundefined

Renders a custom csv export button. Expects the following argument: { exportAllCsv } or, if allowing a filtered export { exportAllCsv, disableFilteredExport, exportFilteredCsv }

rowClassNamefuncFunction

Takes a row object and returns a string that will be applied to the cells within the associated row

rowHeightnumber45

A fixed height applied to each row.

rowsarrayRequired

An array of row objects.

Column Properties

PropertyTypeRequired?DefaultDescription
keyStringA unique string used to identify the column. This string should correspond to a key within your row objects.
titleStringThe title of the column to be displayed for the user.
classNameStringAn optional class name that will be applied to the content of each table cell in this column.
customFilterFunctionGiven a filter term (string) and a row object, returns a boolean for use with Array.prototype.filter
customHeaderFunctionAdd a custom header component when the UI design requires functionality/layout beyond that which the default header can provide
customSortComparerFunctionGiven a sort direction ("ASC" or "DESC") and rows a and b, returns a number for use with Array.prototype.sort
defaultSortBooleanfalseSet to true if this column should be sorted by default. (Only one column should have this property set to true)
defaultSortDirectionStringDESCMust have defaultSort set to true, and be a value of "DESC" or "ASC", if not included or an invalid type will default to "DESC"
excludeFromExportBooleanfalseSet to true to exclude the column from CSV export.
exportDataFunctionGiven a row object, returns data that will be used when exporting table to a CSV file.
filterableBooleantrueSet to false to disable filtering for the column.
filterDataFunctionGiven a row object, returns data that will be used to filter the column. Unlike sortData and filterSortData, this can return an array of values. Overrides filterSortData.
filterSortDataFunctionGiven a row object, returns data that will be used to sort and filter the column.
hideTooltipBooleanfalseSet to true to hide the tooltip for the column.
minWidthNumberOverrides the default minimum column width applied by the table.
renderFunctionGiven a row object, returns renderable content to display within the cell.
rightAlignedBooleanfalseRight aligns the column contents
sortableBooleantrueSet to false to disable sorting for the column.
sortDataFunctionGiven a row object, returns data that will be used to sort the column. Overrides filterSortData.
tooltipFunctionGiven a row object, returns string of text to display as the cell's tooltip.
widthNumberSets a fixed width for the column. Overrides all other width properties.

DEPRECATED_ESVirtualizedTable Basic Example:

ID
Name
Year
9
test9
2020
8
test8
2019
7
test7
2019
6
test6
2018
5
test5
2018
4
test4
2017
3
test3
2017
2
test2
2016
1
test1
2016

DEPRECATED_ESVirtualizedTable Fixed Columns Example (with year column right aligned):

ID
Name
Year
9
8
7
6
5
4
3
2
1
test9
2016
test8
2016
test7
2016
test6
2016
test5
2016
test4
2016
test3
2016
test2
2016
test1
2016

DEPRECATED_ESVirtualizedTable CSV Export Example:

ID
Name
Year
9
test9
2019
8
test8
2018
7
test7
2018
6
test6
2017
5
test5
2017
4
test4
2016
3
test3
2016
2
test2
2015
1
test1
2015

DEPRECATED_ESVirtualizedTable Advanced CSV Export Example:

ID
Name
Year
9
test9
2019
8
test8
2018
7
test7
2018
6
test6
2017
5
test5
2017
4
test4
2016
3
test3
2016
2
test2
2015
1
test1
2015

DEPRECATED_ESVirtualizedTable Empty Example:

ID
Name
Year
No Data

DEPRECATED_ESVirtualizedTable with Abstracted Columns:

Id
Name
Year
9
test9
2016
8
test8
2016
7
test7
2016
6
test6
2016
5
test5
2016
4
test4
2016
3
test3
2016
2
test2
2016
1
test1
2016

DEPRECATED_ESVirtualizedTable with Custom Record Component:

Custom Title
Asset Id: 1
  • Name: test1
  • Year: 2016
Asset Id: 2
  • Name: test2
  • Year: 2015
Asset Id: 3
  • Name: test3
  • Year: 2014
Asset Id: 4
  • Name: test4
  • Year: 2013
Asset Id: 5
  • Name: test5
  • Year: 2012
Asset Id: 6
  • Name: test6
  • Year: 2011
Asset Id: 7
  • Name: test7
  • Year: 2010
Asset Id: 8
  • Name: test8
  • Year: 2009
Asset Id: 9
  • Name: test9
  • Year: 2008

DEPRECATED_ESVirtualizedTable with Custom Header:

Custom Header Title
"I could be a custom search bar that knows how to filter and search on your custom record component!"
Asset Id: 1
  • Name: test1
  • Year: 2016
Asset Id: 2
  • Name: test2
  • Year: 2015
Asset Id: 3
  • Name: test3
  • Year: 2014
Asset Id: 4
  • Name: test4
  • Year: 2013
Asset Id: 5
  • Name: test5
  • Year: 2012
Asset Id: 6
  • Name: test6
  • Year: 2011
Asset Id: 7
  • Name: test7
  • Year: 2010
Asset Id: 8
  • Name: test8
  • Year: 2009
Asset Id: 9
  • Name: test9
  • Year: 2008

Loading Indicators

LoadingAnimation

src/loading-indicators/loading-animation/loading-animation.js

Loading Animation: Renders an animated loading indicator.

Prop nameTypeDefaultDescription
isSmallboolfalse
isVisibleboolfalse

isSmall = true

LoadingOverlay

src/loading-indicators/loading-overlay/loading-overlay.js

Loading Overlay: Creates a semi-transparent mask which overlays a loading component. Displays the loading animation, centered on the overlay.

NOTE: The overlay uses position: absolute. It will position itself relative to its first ancestor with !position: static. You need to set position: relative || fixed || absolute || sticky on the parent.

Prop nameTypeDefaultDescription
isLoadingboolRequired

controls the visibility of the overlay

smallAnimationboolfalse

renders a smaller version of the loading animation

LoadingOverlay

LoadingOverlay with smallAnimation = true

LoadingOverlay over a collection of checkboxes

Dialogs

ModalCreator

src/modal-dialog/modal-creator.js
Prop nameTypeDefaultDescription
childrenunionRequired
One of type: node[], element, node, string
containerClassstring

CSS class to be added to final dialog container. Useful for adding additional styles to your final modal dialog.

contentPaddingbooltrue

modal body content padding

customStylesobjectShape
handleClosefuncnull

handle close should give the consumer control over the isOpen state

isOpenboolfalse
outerContainerClassstring

used for targeting the entire modal to customize with css

renderHeaderbooltrue

should we render the header for the modal

shouldCloseOnOverlayClickbooltrue
showCornerCloseButtonbooltrue

display the corner close button on the top right

titlestring

modal title

ModalCreator basic example:

ModalDialog

src/modal-dialog/modal-dialog.js

Modal Dialog is used by ModalCreator to wrap around the dialog content

Prop nameTypeDefaultDescription
childrenunionRequired
One of type: node[], element, node, string
containerClassstring
contentPaddingbooltrue
customStylesobjectShape
handleClosefuncnull
outerContainerClassstring
renderHeaderbooltrue
shouldCloseOnOverlayClickbooltrue
showCornerCloseButtonbooltrue
titlestring
test modal

Hello World!

This is my modal content

Custom Dialogs

ConfirmationDialog

src/confirmation-dialog/confirmation-dialog.js
Prop nameTypeDefaultDescription
cancelTextstringCancel

Override the default cancel button text

childrennodenull

Provide child components for rendering

contentstringnull

The content of the dialog

contentPaddingbooltrue

Override the default contentPadding of underlying ModalCreator

okTextstringOk

Override the default ok button text

okTypeenumprimary

The type of button used for the OK/Confirm - should be one of the available button types see: https://styles.equipmentshare.com/#button

buttonTypes
onCancelfuncRequired

method to fire off when cancel is clicked

onOkfuncRequired

method to fire off when ok is clicked

showCornerCloseButtonboolfalse

Override the default showCornerCloseButton of underlying ModalCreator

titlestringnull

The title of the confirmation dialog

Confirmation Dialog Example:

Confirmation Dialog Example with no body text:

Confirmation Dialog Example with no custom button text:

Toasts

ToastContainer

src/toasts/toast-container.js

Toast Container: The ToastContainer component must be included in the App somewhere. Portal is used to insure that the container is appended to the Document Body. Be sure to only included this component only once in your app. This is all that is needed to display Toasts.

Prop nameTypeDefaultDescription
classNamestringnull

Toast Container:

Toast

src/toasts/toast.js
Prop nameTypeDefaultDescription
burnToastfuncRequired

Function that is passed in from ToastContainer to remove a toast

toastobjectRequired

The Toast Object { closeOnClick: Boolean, id: Generated Number, message: String, type: String, timeout: Number }

Toast Examples:

Configuring a Toast with Custom Options:

  • closeOnClick: true (default)
  • timeout: 4000 (default)

MultiCheckbox

MultiCheckbox

src/multi-checkbox/multi-checkbox.js
Prop nameTypeDefaultDescription
classNamestringnull

class applied to checkbox component

collapsibleboolfalse

if there are nested children, determines whether they should be collapsible or always expanded

selectAllLabelstringnull

Text label for the select all option, if no value is passed in in no select all option will be present

valuesshape[]Required

Array of values that make up the list

checked: boolis the value checked
id: numberRequiredid of the value
name: nodelabel for the checkbox to display
children: arrayan array of values with the same shape as this value
valuesTogglefuncFunction

Callback for when a value is clicked

MultiCheckbox

Nested MultiCheckbox

Collapsible Nested MultiCheckbox

Popover

ControlledPopoverCreator

src/popover/controlled-popover.js
Prop nameTypeDefaultDescription
alignunionundefined

the align prop passed to the Popover component

One of type: string, string[]
anchorunionundefined

the anchor provided to the Popover component

One of type: string, func
childrennodeRequired

The node used to trigger the popover

closeOnEscbooltrue

close the popover when the Esc key is pressed

closeOnOutsideClickbooltrue

close the popover when the user clicks outside of the popover

closeOnScrollbooltrue

close the popover when the window fires the scroll event

contentanynull

Accepts any elements being passed in that render when the popover is opened

isOpenboolfalse

A boolean that controls the visbility of the popover content

offsetunionundefined

a CSS value or an object that will be used to offset the popover from its anchor

One of type: number, string, shape
onClosefuncnull

a method passed in that is called to close the popover from inside the popover

popoverClassNamestring

custom popover class

Basic Controlled Example:

PopoverCreator

src/popover/popover-creator.js
Prop nameTypeDefaultDescription
alignunionundefined

the align prop passed to the Popover component

One of type: string, string[]
anchorunionundefined

the anchor provided to the Popover component

One of type: string, func
childrenanynull

the popovers contents

closeOnEscbooltrue

close the popover when the Esc key is pressed

closeOnOutsideClickbooltrue

close the popover when the user clicks outside of the popover

closeOnScrollbooltrue

close the popover when the window fires the scroll event

offsetunionundefined

a CSS value or an object that will be used to offset the popover from its anchor

One of type: number, string, shape
onClosefuncnull

called when the popover closes

onOpenfuncnull

called when the popover opens

popoverClassNamestring

custom popover class

triggerfuncnull

a react component that will be passed the functions to open / close the popover

basic popover

Alignment and Anchor

Top Left
Top Center
Top Right
Middle Left
Middle Center
Middle Right
Bottom Left
Bottom Center
Bottom Right

Custom popover anchor

Popover with inputs

Trigger popover on mouse over

Hover over me!

Popover

src/popover/popover.js
Prop nameTypeDefaultDescription
alignunioncenter bottom

the alignment of the popover

One of type: string, string[]
anchorunion( rect ) => ( { left: rect.x + rect.width / 2, top: rect.y + rect.height } )

a function that is used to position the popover on the screen

One of type: string, func
anchorNodeElementnull

the anchor node

childrenanynull

popover contents

classNamestring

custom class

offsetunionnull

a CSS value or an object that will be used to offset the popover from its anchor

One of type: number, string, shape
popover contents

List Group

ListGroup

src/list-group/list-group.js
Prop nameTypeDefaultDescription
childrenanynull
classNamestringnull
noBorderboolfalse
  • Item 1
  • Item 2
  • Item 3
  • Item 4
  • Item 5

Without border

  • Item 1
  • Item 2
  • Item 3

Inside a Card

Card Header

  • Item 1
  • Item 2
  • Item 3

Inside a Popover

Side Drawer

SideDrawerCreator

src/side-drawer/side-drawer-creator.js
Prop nameTypeDefaultDescription
childrennodenull
closeOnBackdropClickbooltrue
drawerWidthstringnull
isOpenboolfalse
onClosefuncnull
scrollableboolfalse
showBackdropbooltrue
titlenodenull

SideDrawer

src/side-drawer/side-drawer.js
Prop nameTypeDefaultDescription
childrennodenull
closeOnBackdropClickbooltrue
drawerWidthstringnull
isOpenboolfalse
onClosefuncnull
scrollableboolfalse
showBackdropbooltrue
titlenodenull

SideDrawer in relative div

example drawer

Hello World!

This is example content

Additional Components

Avatar

src/avatar/avatar.js
Prop nameTypeDefaultDescription
childrennodeRequired

child elements to render inside of the avatar

onClickfuncFunction

function used when the avatar is clicked on

shapeenumcircle

the shape of the avatar, must be 'circle' or 'square'

One of: square, circle
sizenumber2

the size of the avatar in 'em'

Basic Avatars:

JS
FB

Avatar Sizes:

JS
JS
JS
FB
FB
FB

Card

src/card/card.js
Prop nameTypeDefaultDescription
cardClassstringnull

A custom class name that can be added to the card

childrenanynull

Any children that will be rendered inside of the card

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus sed feugiat lacus. Morbi erat magna, malesuada et pulvinar porttitor, dapibus nec ligula. Pellentesque commodo eleifend tellus, id venenatis nunc egestas sit amet. Nam tincidunt mattis lobortis. Aenean at dolor gravida, efficitur nulla et, venenatis ligula. Quisque hendrerit nisl eu metus dictum interdum. Etiam faucibus bibendum viverra. Vivamus consectetur velit id ligula fringilla congue. In sagittis ligula eget tristique fringilla.

Custom Class

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus sed feugiat lacus. Morbi erat magna, malesuada et pulvinar porttitor, dapibus nec ligula. Pellentesque commodo eleifend tellus, id venenatis nunc egestas sit amet. Nam tincidunt mattis lobortis. Aenean at dolor gravida, efficitur nulla et, venenatis ligula. Quisque hendrerit nisl eu metus dictum interdum. Etiam faucibus bibendum viverra. Vivamus consectetur velit id ligula fringilla congue. In sagittis ligula eget tristique fringilla.

Card with 'flush' Card.Body

Some flush mounted content (gray box)

Card with tabs

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus sed feugiat lacus. Morbi erat magna, malesuada et pulvinar porttitor, dapibus nec ligula. Pellentesque commodo eleifend tellus, id venenatis nunc egestas sit amet. Nam tincidunt mattis lobortis. Aenean at dolor gravida, efficitur nulla et, venenatis ligula. Quisque hendrerit nisl eu metus dictum interdum. Etiam faucibus bibendum viverra. Vivamus consectetur velit id ligula fringilla congue. In sagittis ligula eget tristique fringilla.

Full Card example with subcomponents

Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus sed feugiat lacus. Morbi erat magna, malesuada et pulvinar porttitor, dapibus nec ligula. Pellentesque commodo eleifend tellus, id venenatis nunc egestas sit amet. Nam tincidunt mattis lobortis. Aenean at dolor gravida, efficitur nulla et, venenatis ligula. Quisque hendrerit nisl eu metus dictum interdum. Etiam faucibus bibendum viverra. Vivamus consectetur velit id ligula fringilla congue. In sagittis ligula eget tristique fringilla.

Card with header image

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus sed feugiat lacus. Morbi erat magna, malesuada et pulvinar porttitor, dapibus nec ligula. Pellentesque commodo eleifend tellus, id venenatis nunc egestas sit amet. Nam tincidunt mattis lobortis. Aenean at dolor gravida, efficitur nulla et, venenatis ligula. Quisque hendrerit nisl eu metus dictum interdum. Etiam faucibus bibendum viverra. Vivamus consectetur velit id ligula fringilla congue. In sagittis ligula eget tristique fringilla.

Chip

src/chip/chip.js
Prop nameTypeDefaultDescription
childrenanyRequired
chipTypeenumdefault
One of: default, negative, positive, primary
classNamestringnull
closeLabelstringRemove
hrefstringnull
iconElementanynull
onClickfuncnull
onClosefuncnull
roundedboolfalse
showCloseIconboolfalse

Basic chips

Basic Chip
Clickable Chip
rounded chip
Link Chip

Chip Types

default Chip
Clickable
Link
primary Chip
Clickable
Link
negative Chip
Clickable
Link
positive Chip
Clickable
Link

Chips with close icon

Chip with close icon
Rounded Chip
Clickable Chip
Link Chip

Chips with icons

ES

Chip with icon

Foo

Bar
Image as icon
WebPack
React

CsvDownload

src/csv-download/csv-download.js
Prop nameTypeDefaultDescription
csvStringstringRequired

csv data string to be exported on button click

csvTitlestringRequired

title of download

disabledboolfalse

boolean to disable button

endDateobjectundefined

date object of end date

startDateobjectundefined

date object of start date

FilePreview

src/file-preview/file-preview.js
Prop nameTypeDefaultDescription
classNamestringundefined

Class name to be applied to the container element (which may be ,

, or
, depending on the download props passed in)

downloadUrlstringundefined

URL to link for download

fileInfostringundefined

The info text to be rendered in the file preview box

fileNamestringundefined

The title text to be rendered at the top in the file preview box

iconOverridestringundefined

Full icon name to use instead

iconTypestringundefined

Determines the icon to display in the left side. Options are DOC, XLS, ZIP, IMG, PDF, FILE

metadatashapeundefined

Metadata returned from the file service. If provided, the FilePreview component will use it to display with the original filename, the file size and type as the file info string, and the appropriate icon for the mime-type. These may still be overridden by other props.

mime_type: string
original_filename: string
size_bytes: number
onClickfuncundefined

Function to be called on click of the component, i.e. the function to download the file, instead of using a direct URL

File Preview Defaults

Untitled

FILE

Using Metadata

helen.jpg

3.42 KB Image

presentation.pptx

43.95 KB FILE

inventory-2019-08.xls

11.77 MB Excel File

Override_file_name.xls

11.77 MB Excel File

Icon Options

my_cat.png

41 MB PNG

cat_pictures.zip

ZIP Archive

Cat photos.docx

Word Doc

cat_ratings.xlsx

Excel

Cat sweater pattern.pdf

16 KB PDF

cats

FILE

With OnClick defined

Icon Override

Not_A_Virus.exe

82 MB Attachment

GoogleMap

src/google-map/google-map.js
Prop nameTypeDefaultDescription
centershapeShape
latitude: number
longitude: number
mapTypeControlbooltrue

Turn the Street/Satellite topography buttons on(true) or off(false).

mapTypeIdstringroadmap
maxZoomnumber21
setMapfuncFunction
templateobjectShape
zoomnumber7

Basic Map:

This is example code, but it will not function without the correct google maps script import and API key available on the consuming application.

ReferenceError: google is not defined

StaticGoogleMap

src/static-google-map/static-google-map.js
Prop nameTypeDefaultDescription
apiKeystringAIzaSyAzLinN-4rrmzamxNuZiyf3il_aE_ALEFo
centerunionRequired
One of type: string, shape
mapTypeenumroadmap
One of: roadmap, satellite, hybrid, terrain
sizeshapeShape
width: number
height: number
zoomunion15
One of type: string, number

Static Google Map:

Map type examples centered on "Berkeley, CA":

Roadmap
Satellite
Hybrid
Terrain

Zoom examples centered on 40.8116, -73.9465:

Zoom 21
Zoom 15
Zoom 10
Zoom 5

Icon

src/icon/icon.js

In order to use this component correctly the icon desired must be imported into the icon-config.js file and added to the FontAwesome library. Once this has been done you can refer to the icon by it's new name (fasPlus). This allows multiple icons from different typesets to be imported and referenced if needed (falPlus, fasPlus)

See icon-config.js for an example on how to import and add icons to the Library

Prop nameTypeDefaultDescription
classNamestringnull
maskstringnull

The mask icon name to be rendered - pulled from iconList in icon-config.js

namestringRequired

The icon name to be rendered - pulled from iconList in icon-config.js

onClickfuncnull

A function used to trigger when the icon is clicked

Icon example:

Icon with custom class:

Icon with onClick:

Icon with Layers:

FontAwesome Props Available

PropertyTypeDescription
sizeStringSets the size of the icon, one from the following list: xs, sm, lg, 2x, 3x, 4x, 5x, 6x, 7x, 8x, 9x, 10x
fixedWidthBooleanSet's the icon to a fixed width
inverseBooleanInverts the colors of the icon
listItemBooleanSets several properties on the icon to behave better as a list icon
rotationNumberDegrees in which to rotate the icon
flipStringWhen used must be one of "horizontal", "vertical" or "both"
borderBooleanShould a border be added around the icon
spinBooleanAdds a slow rotation to the icon
pulseBooleanAdds a stepped rotation to the icon
pullStringOne of "left" or "right" - pulls the Icon to the side of the content displayed
maskStringMust be another valid FontAwesome icon to be used as the outer shell for the main icon
transformString/ObjectA set of other variables available to transform and modify the icons

Examples:

Size:

Rotation:

Flip:

Animations:

Pull:

Gatsby believed in the green light, the orgastic future that year by year recedes before us. It eluded us then, but that’s no matter — tomorrow we will run faster, stretch our arms further... And one fine morning — So we beat on, boats against the current, borne back ceaselessly into the past.

Fixed Width, Masking & Inverse:

InputLabel

src/input-label/input-label.js
Prop nameTypeDefaultDescription
childrenanynull
classNamestringnull
htmlForstringnull
labelstringnull
requiredboolfalse

Input With Label

Input

Required Input Label

Input

MultiSelectCurtain

src/multi-select-curtain/multi-select-curtain.js

MultiSelectCurtain component

Prop nameTypeDefaultDescription
clickOutsideToCloseboolfalse

Boolean to determine if clicking outside of the curtain will close it or not

curtainTogglefuncFunction

Callback for when a toggle element is clicked

directionenumcenter

Direction to open curtain

One of: center, left, right
disabledboolfalse

Disables the toggle functionality of the curtain

isVisiblebooltrue

Boolean to show/hide component

listFooterChildrenelementnull

React element to be rendered after the list of values

parentCanCloseboolfalse

Boolean to determine if passing showCurtain will actually toggle any changes

selectAllLabelstringnull

Text label for the select all option, if no value is passed in in no select all option will be present

showCurtainboolfalse

Allows passing a boolean prop to open/close curtain

toggleElementelementnull

React element that is clicked on to show the MultiSelectCurtain

valuesshape[]Required

Array of values that make up the list

checked: boolis the value checked
id: numberid of the value
name: stringlabel for the checkbox to display
valuesTogglefuncFunction

Callback for when a value is clicked

Dropdown Positioning:

Custom Footer Elements:

Without a Select All Option:

Timestamp

src/timestamp/timestamp.js
Prop nameTypeDefaultDescription
dateTimeobjectRequired
formatstringh:mm a

Tooltip

src/tooltip/tooltip.js
Prop nameTypeDefaultDescription
childrennode<div className={tooltipStyles.defaultTrigger}>?</div>

Element that is hoverable to show tooltip

directionstringright

Direction to show tooltip

textunionRequired

Text inside of tooltip

One of type: string, node

Tooltip Right (default):

Hover Over Me

Tooltip Left:

Hover Over Me

Tooltip Top:

Hover Over Me

Tooltip Bottom:

Hover Over Me

Markdown

src/markdown/markdown.js
Prop nameTypeDefaultDescription
classNamestringnull
containeruniondiv
One of type: string, func
optionsshapenull
html: bool
linkify: bool
typographer: bool
breaks: bool
sourcestringRequired

h1 Heading

h2 Heading

h3 Heading

h4 Heading

h5 Heading
h6 Heading

Emphasis

This is bold text
This is bold text
This is italic text
This is italic text
Strikethrough

Lists

Unordered

  • Create a list by starting a line with +, -, or *
  • Sub-lists are made by indenting 2 spaces:
    • Marker character change forces new list start:
      • Ac tristique libero volutpat at
      • Facilisis in pretium nisl aliquet
      • Nulla volutpat aliquam velit
  • Very easy!

Ordered

  1. Lorem ipsum dolor sit amet
  2. Consectetur adipiscing elit
  3. Integer molestie lorem at massa

Tables

Option Description
data path to data files to supply the data that will be passed into templates.
engine engine to be used for processing templates. Handlebars is the default.
ext extension to be used for dest files.

Right aligned columns

Option Description
data path to data files to supply the data that will be passed into templates.
engine engine to be used for processing templates. Handlebars is the default.
ext extension to be used for dest files.

example drawer

Hello World!

This is my side drawer content