Pick a theme:      
src/components/Identity/Colors/Colors.jsx
Prop nameTypeDefaultDescription
themeshapeShape
#a5bce0

primaryColorLight

#4276c9

primaryColor

#305ea8

primaryColorDark

#f8f8f8

greyLight

#a5a5a5

grey

#2e2e2e

greyDark

#e9e9e9

greyNeutral

#c02519

error

src/components/Identity/Typography/Typography.jsx
Prop nameTypeDefaultDescription
themeshapeShape

TITLE

Display Title

Light, Font-size 42px, Line-height 54px

className="weight-light"

H1

h1. THP HTML Heading

Bold, Font-size 42px, Line-height 54px

H2

h2. THP HTML Heading

Bold, Font-size 36px, Line-height 40px

H3

h3. THP HTML Heading

Bold, Font-size 24px, Line-height 28px

H4 / H5 / H6

h4. THP HTML Heading

h5. THP HTML Heading
h6. THP HTML Heading

Bold, Font-size 18px, Line-height 24px

P / Body text

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel libero euismod, volutpat nibh id, facilisis risus. Mauris vel hendrerit tellus. Praesent eu ligula eget lacus pharetra lacinia ac vitae nisl. Sed vitae dictum sem. Proin ut turpis ut tortor iaculis dignissim elementum ut enim.

Regular, Font-size 14px, Line-height 20px

P: Italic

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel libero euismod, volutpat nibh id, facilisis risus. Mauris vel hendrerit tellus. Praesent eu ligula eget lacus pharetra lacinia ac vitae nisl. Sed vitae dictum sem. Proin ut turpis ut tortor iaculis dignissim elementum ut enim.

Regular, Italic, Font-size 14px, Line-height 20px

className="italic-text"

P: Bold

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel libero euismod, volutpat nibh id, facilisis risus. Mauris vel hendrerit tellus. Praesent eu ligula eget lacus pharetra lacinia ac vitae nisl. Sed vitae dictum sem. Proin ut turpis ut tortor iaculis dignissim elementum ut enim.

Bold, Font-size 14px, Line-height 20px

className="weight-bold"

P: Bold & Italic

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel libero euismod, volutpat nibh id, facilisis risus. Mauris vel hendrerit tellus. Praesent eu ligula eget lacus pharetra lacinia ac vitae nisl. Sed vitae dictum sem. Proin ut turpis ut tortor iaculis dignissim elementum ut enim.

Bold, Italic, Font-size 14px, Line-height 20px

className="weight-bold italic-text"

Link

Text Link

H1 Text Link

H2 Text Link

H3 Text Link

H4 Text Link

P Text Link

  1. Ol-Li Text Link
  2. Not a link

Default link: Regular, Font-size 16px

Link may be wrapped inside another typography tag, in which case it will match that styling.

Note: for buttons styled likelinks or links styled like buttons, see Button component.

Quote

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer vel libero euismod, volutpat nibh id, facilisis risus. Mauris vel hendrerit tellus. Praesent eu ligula eget.

Regular, Font-size 18px, Line-height 26px

Ordered List

  1. Lorem ipsum dolor sit amet
  2. consectetur adipiscing elit
  3. Integer vel libero euismod
  4. volutpat nibh id, facilisis risus
  5. Mauris vel hendrerit tellus.
  6. Praesent eu ligula eget lacus pharetra lacinia ac vitae nisl.
  7. Sed vitae dictum sem.
  8. Proin ut turpis ut tortor iaculis dignissim elementum ut enim

Regular, Font-size 14px, Line-height 20px

Unordered List

  • Lorem ipsum dolor sit amet
    • nested list item's parent `ul` gets class `.nested-list`
  • Integer vel libero euismod
    • volutpat nibh id, facilisis risus
    • Mauris vel hendrerit tellus.
    • Praesent eu ligula eget lacus pharetra lacinia ac vitae nisl.
    • Sed vitae dictum sem.
    • Proin ut turpis ut tortor iaculis dignissim elementum ut enim

Regular, Font-size 14px, Line-height 20px

Nested ul for nested list items get className="nested-list"

src/components/Elements/Accordion/Accordion.jsx
Prop nameTypeDefaultDescription
childrennodeRequired
customClassClosedstring

Custom class for open wrapping children in closed mode

customClassOpenstring

Custom class for open wrapping children in open mode

Options

The Accordion element generally expects two child nodes, a "top" and a "bottom" node.

<Accordion customClassOpen="qAndaOpen" customClassClosed="qAndaClosed">
    <div className="qClass" style={{ backgroundColor: 'white', border: '1px solid black', padding: '30px', }}>
        My Question
    </div>
    <div className="aClass" style={{ backgroundColor: 'white', border: '1px solid red', padding: '30px', }}>
        <p>My Answer 1</p>
        <p>My Answer 2</p>
    </div>
</Accordion>
My Question

My Answer 1

My Answer 2

src/components/Elements/ActionBar/ActionBar.jsx
Prop nameTypeDefaultDescription
childrennodeRequired
onClickfuncRequired
dontCollapseIfOnlyOneOptionboolfalse
moreIconClassstringfa-ellipsis-h
moreTextstringMore
optionsToShownumber3
optionsWrapperClassnamestring
optionsWrapperStylesobjectShape
textAlignenumnull
One of: left, right, center
tooltipMenuPropsobjectShape
useDropdownStyleForMoreActionsboolfalse

Options

The ActionBar element has an exposed Option object that is used to add options. This is the only allowed child type.
Note: only options being shown can be disabled

<ActionBar onClick={(value) => { alert(value); }} optionsToShow={3}>
    <ActionBar.option value="view" iconClass="fa-search" disabled>View</ActionBar.option>
    <ActionBar.option value="edit" iconClass="fa-pencil" highlighted>Edit</ActionBar.option>
    <ActionBar.option value="option" iconClass="fa-check-box-outline-blank">Select</ActionBar.option>
    <ActionBar.option value="copy" iconClass="fa-copy-btl">Copy</ActionBar.option>
    <ActionBar.option value="move" iconClass="fa-move">Move</ActionBar.option>
</ActionBar>

An onClick callback will pass the value attribute specified on each ActionBar.option.

View
Edit
  More
Select
Copy
Move

You can specify to not add the "More" menu if there's only one option.

View
Edit
Select

The ActionBar container is flexible and will expand width-wise to fill its parent container.

View
Edit
Copy
  More
Move

View
Edit
Copy
  More
Move

View
Edit
Copy
  More
Move

Options to show

The number of options shown is configurable, in addition to the "More" text and iconClass.

View
Edit
Copy
  More
Move

View
Edit
  Much More
Copy
Move

View
  Options
Edit
Copy
Move

States & Toggle

Like
Select
Bloop

Custom themed

View
Edit
Copy
  More
Move

ActionBars with Borders

View
Add
Reject
src/components/Elements/Button/Button.jsx
Prop nameTypeDefaultDescription
buttonStyleenumnormal

Button's style type

One of: normal, primary, inverse, textLink, plain, transparent, tertiary, secondary, flat
childrennode

So many kids.

classNamestring
colorunionnull

Override the colour of the button text

One of type: number, string
dataTestTargetstring

Provide a property that can be targeted by Selenium tests

disabledboolfalse
hrefstring

Pass href link if button should use <a /> tag

iconClassstringnull
iconImgSrcboolfalse

Set to true if iconClass is actually an img src

iconRightboolfalse
idstring

id to tag the button component for targetting

isFullWidthboolfalse

Set true if button should be full-width, else leave blank

loadingboolfalse
minHeightunion0
One of type: number, string
minWidthunion0
One of type: number, string
noUnderlinebooltrue
onClickfuncFunction

Function to call when button is clicked

sizeenumnormal

Size of the button

One of: normal, large, small, fill

Pass the function for the action to be called by that button in the onClick prop. Alternatively, pass an href prop for <a /> functionality instead.

<Button onClick={(e) => alert('Clicky clicky!', e.target)}>Click me</Button>

Button style

Use any of the available button style types to quickly create a styled button. Just modify the buttonStyle prop.











Size

Modify the size prop to select the button size, or make the button block level by adding the isFullWidth prop.

Flexible sizing

Choosing fill as the size prop will cause the button to fill the available space inside its parent container. It achieves this using CSS3 flexbox, so the parent container must use display: flex.

Button tags

By default, the <Button /> component generates a <button /> DOM element tag. If you need a link that uses button styling, pass a link in the href prop and it will make a <a /> element instead.

Button states

Disabled



Loading

Navigation Buttons

Only for Confetti Theme

Custom themed

src/components/Elements/Checkbox/Checkbox.jsx
Prop nameTypeDefaultDescription
checkboxStyleenumnone
One of: none, white, standard, primary-color-light, primary-color
checkedboolfalse
dataTestTargetstring
disabledboolfalse
errorboolfalse
labelstring
namestring
onClickfuncFunction
valuestring

Default

long text

Mulitple Colors

Disabled



Error

Custom themed



src/components/Elements/CTAButton/CTAButton.jsx
Prop nameTypeDefaultDescription
onClickfuncRequired
childrennodefalse
dataTestTargetstring

Provide a property that can be targeted by Selenium tests

disabledboolfalse
iconClassstringfa-plus
iconHoverClassstringfa-plus-circle
iconPositionenumtop
One of: top, bottom
idstring

id to tag the button component for targetting

inlineIconboolfalse

Custom themed

src/components/Elements/DateInput/DateInput.jsx
Prop nameTypeDefaultDescription
callbackFunctionfuncFunction
disabledboolfalse
fontColorenumnull
One of: black, white, grey
initialValuestring

Initial date for the input

inputClassNamestring
inputIdstringinput-date
labelstring
namestringname
prefixDatestringEnter today:␣

prefixDate, string to append on additional date

savingTxtstring
showAutoFillBtnboolfalse
showHelperDateMessageboolfalse
styleInputshapeShape
color: string
fontSize: number
backgroundColor: string
valuestring

Date to be currently shown

Options

<DateInput />
Saving...

Helper Message + Autofill State

Enter a date

Reinput State

Optionally add a 2 digit day

Custom themed

Enter a date
src/components/Elements/DetectIe/DetectIe.jsx
Prop nameTypeDefaultDescription
childrennodeRequired

The Netscape Navigator of the modern times: Internet Explorer. The children of this component will not be rendered in IE. It also includes a utility function getIeVersion for use in other components. getIeVersion returns false is the browser is not internet explorer.

The following example will not render in IE:

Congrats, you are NOT using Internet Explorer.
src/components/Elements/DockedMessage/DockedMessage.jsx
Prop nameTypeDefaultDescription
isOpenboolRequired
onRequestClosefuncRequired
childrennode<noscript />
customClassstring

add a custom css class to the modal body

darkOverlayboolfalse
headerChildrenunknown<noscript />
onAfterOpenfuncnull
sizeenumdefault
One of: default, large, full

Custom themed

src/components/Elements/Flames/Flames.jsx
Prop nameTypeDefaultDescription
flameHeightnumber120

Add some extremely subtle flare to your page. It will only work if you have at least 37 pieces on (but no less than 15).

Current pieces of flare: 15




src/components/Elements/FullWidthMenu/FullWidthMenu.jsx
Prop nameTypeDefaultDescription
childrennodeRequired
titlenodeRequired

Text, button, or any other element. This element will be displayed as the title section of the element, aligned on the left side of the bar on a single line.

fixedPosTopstring0
isFixedboolfalse
midsectionnodenull

This optional element occupies the middle section of the bar, within whatever space is left over from the title and trigger elements.

onClickfuncFunction

a callback for when a menu option is clicked on. It will return the option's value prop

onMenuClosefuncFunction
overrideClosenodenull

Override the close button being displayed on menu open

scrollElementSelectorstringnull

If the menu trigger is inside an element that scrolls, give a reference to the parent container so that scroll events can be handled correctly. This is a CSS selector.

triggernode<div style={{ fontSize: '30px', }}><i className="fa fa-hamburger" /></div>

Text, button, or any other element. This element will be displayed as the "trigger" for showing the tooltip. Clicking anywhere inside this element will show/hide the tooltip.

Specific variant of TooltipMenu that is used for navigation-style header bars.

<div>
  <FullWidthMenu title={'My Title'} onClick={(value) => { alert(value); }}>
    <FullWidthMenu.option value='copy'><i className="fa fa-copy-btl" />Copy</FullWidthMenu.option>
    <FullWidthMenu.option value='move'><i className="fa fa-move" />Move</FullWidthMenu.option>
    <FullWidthMenu.option value='down'><i className="fa fa-download" />Download</FullWidthMenu.option>
  </FullWidthMenu>
</div>
My Main Title
Copy
Move
Download
src/components/Elements/Notification/Notification.jsx
Prop nameTypeDefaultDescription
closeTimingenumnull
One of: long, short
customTimenumbernull
inlineboolfalse

When using the inline property, it will render the notification inline, instead of within a modal

isOpenboolfalse
messagestring
onRequestClosefuncFunction
showCloseButtonboolfalse

Notifications and such.

Inline rendering

Look, I am inline!

Custom themed

src/components/Elements/PaginationBar/PaginationBar.jsx
Prop nameTypeDefaultDescription
currentPagenumber1
disableLimitSetboolfalse

Disable display of the limit set

disablePageSetboolfalse

Disable display of the goto page

disableTotalboolfalse

Disable display of the total results

limitnumber20
onPageSelectfuncFunction

Callback that gets passed an object with current "page" and current "limit"

totalnumber0

The PaginationBar helps to navigate paginated data. Users can select specific pages via the page blocks, or the page setter input and dropdown. The number of per-page entries can also be set.

All elements apart from the central page numbers element can be toggled.

All elements on

400 Total Results
8
20
50
100
500
Per Page
1
2
3
4
5
6
...
50
Go to page
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

All elements off

1
2
3
4
5
6
...
50
src/components/Elements/ProgressBar/ProgressBar.jsx
Prop nameTypeDefaultDescription
cylonboolfalse

Cylon mode!

logoUrlstringhttps://www.enwoven.com/assets/144x144.png
maxnumber100
titlestringLoading...
transitionDurationnumber500
valuenumber100

This is a progress bar component, thanks.

loading...
Loading...


Custom logos and labels

Get a bare progress bar by setting logoUrl and title to empty strings.



loading...
Cheezing...


loading...
Making history...



Widths

The width stretches to fill the parent container.

loading...
Loading...


loading...
Loading...


loading...
Loading...



Custom themed

loading...
Loading...
src/components/Elements/Radio/Radio.jsx
Prop nameTypeDefaultDescription
namestringRequired
valuestringRequired
checkedboolfalse
dataTestTargetstring
disabledboolfalse
errorboolfalse
labelstring
onClickfuncFunction

This is a "dumb" implementation of the radio element. They aren't aware of each other, so you'll have to manage their checked or unchecked state via a parent component's state.

class RadioExample extends React.Component {
    constructor(props) {
        super(props);

        // decide which one gets selected by default
        this.state = {
            selected: "1",
        }
        this.onClick = this.onClick.bind(this);
    }
    onClick(e, params) {
        this.setState({
            selected: params.value,
        });
    }
    render() {

        // the "checked" prop is decided by this component's state.
        return (
            <div>
                <Radio
                    checked={this.state.selected === "1"}
                    name="radio"
                    label="1"
                    value="1"
                    onClick={this.onClick} 
                 />
                <Radio
                    checked={this.state.selected === "2"}
                    name="radio"
                    label="2"
                    value="2"
                    onClick={this.onClick} 
                 />
                <Radio
                    checked={this.state.selected === "3"}
                    name="radio"
                    label="3"
                    value="3"
                    onClick={this.onClick} 
                 />

            </div>
        );

    }
}
<RadioExample1 />

Default





Disabled







Error





Custom themed



src/components/Elements/RichTextInput/RichTextInput.jsx
Prop nameTypeDefaultDescription
allowClearTextbooltrue
allowLinkNewWindowboolfalse
allowMentionsboolfalse
buttonListenum[][ 'bold', 'italic', 'underline', 'hyperlink', 'headline', 'blockquote', 'unordered-list', 'ordered-list', ]
disabledboolfalse
errorboolfalse
heightunion100%
One of type: number, string
helpTextstring
initialValueunion

Changing initialValue will reset the state, useful for reuse

One of type: object, string
initialValueRawobjectnull
labelstring
limitnumber0
mentionOnAddfuncFunction
mentionOnClickfuncnull
mentionSearchChangefuncFunction
mentionSuggestionsarray[]
onChangefuncFunction
onSavefuncFunction
placeholderstringClick here to enter text
statusTextstring
transparentboolfalse
widthunion100%
One of type: number, string

Size

... and some other stuff. The underlining and html tags are to test xss issues with input text parsing.

Thanks a lot!




underline me please, thanks
<u>hello there</u><script>alert('wat');</script>"
  • list one
  • list two

  • three
  • four

This is another paragraph. Thanks!
Thanks a lot!
  1. one
  2. two
  3. three

Space me out, thanks!

block this, yass.

and this two
one more for good luck

yeah.

ok

Label, HelpText, and Placeholder Text:

a
This is the help text

More Examples

Saving text:

Click here to enter text

Option to have links open in new window:

Markdown Example:

Markdown as provided as initialValue and rendered in text editor!!!!!
This is the help text

Transparent

Setting transparent will make the text input transparent with white text.

Transparent

Transparent

Transparent

Transparent

Transparent

Character Limit

A character count and limit can be displayed using the limit option. When the text length exceeds the limit, the error styling is applied, the status text displays the number of characters by which the text exceeds the limit, and the changes do not save.

0 / 10 Characters
This text input displays a limit of 10 characters

Disabled

This text cannot be changed
You can include helpText

Error

Click here to enter text

You can include helpText

Raw input

Raw data input from the text editor itself can be provied to a new instance of the editor via initialValueRaw

Thanks a lot!




underline me please, thanks
<u>hello there</u><script>alert('wat');</script>"
  • list one
  • list two

  • three
  • four

This is another paragraph. Thanks!
Thanks a lot!
  1. one
  2. two
  3. three

Space me out, thanks!

block this, yass.

and this two
one more for good luck

yeah.

ok

Mentions

Click here to enter text
src/components/Elements/Table/Table.jsx
Prop nameTypeDefaultDescription
childrennodenull

It's a table. As such, it needs no introduction but, well, here we are.

IDTitleOwnerPrivacyVisibilityOptions
OneHere is a great titleNot JerryVery20/20Click!
2Higgilty piggiltyMister DonutReallyGood
76Nice project buddyMiss CongenialityPrivate ;-)Public

Custom themed

IDTitleOwnerPrivacyVisibilityOptions
OneHere is a great titleNot JerryVery20/20Click!
2Higgilty piggiltyMister DonutReallyGood
76Nice project buddyMiss CongenialityPrivate ;-)Public
src/components/Elements/Tabs/Tabs.jsx
Prop nameTypeDefaultDescription
childrennodeRequired
customClassstring

Custom CSS class for title

customParentClassstring
customTabsClassstring

Custom CSS class for tabs list

customWrapperClassstring
freezeTabListboolfalse

Set the side navigation title and tab items to remain in place for vertical orientation.

indexnumber0

Optionally, set the currently selected tab index via this prop. Tabs are 0-indexed

onTabClickfuncFunction
orientationenumhorizontal

Stack the tabs horziontally on the top (content on bottom), or left side vertically (content on right)

One of: horizontal, vertical
titlestring
  • Info
    Tooltip!
    Info
  • Comments
  • Misc

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi mattis libero ac porta rhoncus. Fusce vel lectus consequat, tristique ante lacinia, hendrerit magna. Sed vel nunc et nisi semper euismod sed non nisi. Ut eu ipsum euismod, viverra odio non, pellentesque lectus. Duis mollis nisi eget hendrerit bibendum. Nunc interdum urna et quam sagittis, ut aliquam tellus tempus. Vivamus aliquam elit eu ipsum scelerisque laoreet. Nulla tincidunt justo non sapien consequat malesuada. In eu sem vitae turpis auctor varius ac vitae est. In hac habitasse platea dictumst. Nulla facilisi. Ut eget nunc vel dolor ultricies lacinia at vel velit. Fusce dapibus id nibh vitae condimentum. Aenean fringilla vel tellus pellentesque cursus.



Tabs Title
  • Great
    Tooltip!
    Info
  • Comments
  • Misc

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi mattis libero ac porta rhoncus. Fusce vel lectus consequat, tristique ante lacinia, hendrerit magna. Sed vel nunc et nisi semper euismod sed non nisi. Ut eu ipsum euismod, viverra odio non, pellentesque lectus. Duis mollis nisi eget hendrerit bibendum. Nunc interdum urna et quam sagittis, ut aliquam tellus tempus. Vivamus aliquam elit eu ipsum scelerisque laoreet. Nulla tincidunt justo non sapien consequat malesuada. In eu sem vitae turpis auctor varius ac vitae est. In hac habitasse platea dictumst. Nulla facilisi. Ut eget nunc vel dolor ultricies lacinia at vel velit. Fusce dapibus id nibh vitae condimentum. Aenean fringilla vel tellus pellentesque cursus.

Tabs consist of several related elements in the following form:

import { Tabs, TabList, Tab, TabPanel, } from 'Tabs';

const MyComponent = () => (
    <Tabs>
        <TabList>
            <Tab>One</Tab>
            <Tab>Two</Tab>
            <Tab>Three</Tab>
        </TabList>
        <TabPanel>Content One</TabPanel>
        <TabPanel>Content Two</TabPanel>
        <TabPanel>Content Three</TabPanel>
    </Tabs>
);

Tab elements can either be imported separately, as shown above, or can be referenced statically from the top-level Tabs component:

import Tabs from 'Tabs';

const MyComponent = () => (
    <Tabs>
        <Tabs.List>
            <Tabs.Tab>One</Tabs.Tab>
            <Tabs.Tab>Two</Tabs.Tab>
            <Tabs.Tab>Three</Tabs.Tab>
        </Tabs.List>
        <Tabs.Panel>Content One</Tabs.Panel>
        <Tabs.Panel>Content Two</Tabs.Panel>
        <Tabs.Panel>Content Three</Tabs.Panel>
    </Tabs>
);

Other notes:

  • The <TabList /> must be the first child of Tabs
  • The number of Tabs must be equal to the number of TabPanels
  • TabPanels are removed from the DOM when they are hidden.

Custom themed

Tabs Title
  • Info
  • Comments
  • Misc

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi mattis libero ac porta rhoncus. Fusce vel lectus consequat, tristique ante lacinia, hendrerit magna. Sed vel nunc et nisi semper euismod sed non nisi. Ut eu ipsum euismod, viverra odio non, pellentesque lectus. Duis mollis nisi eget hendrerit bibendum. Nunc interdum urna et quam sagittis, ut aliquam tellus tempus. Vivamus aliquam elit eu ipsum scelerisque laoreet. Nulla tincidunt justo non sapien consequat malesuada. In eu sem vitae turpis auctor varius ac vitae est. In hac habitasse platea dictumst. Nulla facilisi. Ut eget nunc vel dolor ultricies lacinia at vel velit. Fusce dapibus id nibh vitae condimentum. Aenean fringilla vel tellus pellentesque cursus.

src/components/Elements/Tag/Tag.jsx
Prop nameTypeDefaultDescription
labelstringRequired
disabledboolfalse
onClickfuncFunction

a callback for when the "x" button is clicked. It is passed two arguemnts: value, and label

valueunion
One of type: shape, string

Custom theme

src/components/Elements/TextInput/TextInput.jsx
Prop nameTypeDefaultDescription
namestringRequired
autoCompleteenumoff
One of: on, off
captionboolfalse
dataTestTargetstring

Provide a property that can be targeted by Selenium tests

dataTestTargetSuggestionsstringdata-suggestions-list

Provide a property for suggestions that can be targeted by Selenium tests

disabledboolfalse
errorboolfalse
fontSizenumber0
helpTextstring
iconClassstringnull
labelstring
limitnumber0
lineSpacingenumnull
One of: single, double, halfsies
multilineboolfalse

if true, use a textarea instead of a single line input

onBlurfuncFunction
onChangefuncFunction
onFocusfuncFunction
onKeyUpfuncFunction
onSuggestfuncFunction
placeholderstring
resizablebooltrue
savingTxtstring

top right placement normally used for saving indicator

sizeenumnormal

Size of the text input

One of: normal, large, flex, fit
styleenumnormal

style

One of: normal, inverse, inverse-transparent
suggestionsany[][]
textAlignenumleft
One of: left, right, center
typestringtext
valuestring

Because they both share many properties, textarea and <input type="text" /> have been merged into a single TextInput component. Toggle usage by setting multiline to true or false accordingly.

Size

Saving...


Inverse style and customizing



Transparent

Setting style to transparent-inverse will make the text input / textarea transparent with white text.

Multline and flex sizing

Setting size to flex allows the width and height of the textinput to fill the surrounding parent div.

Fit content sizing

Caption with counter and flex sizing

Setting size to flex allows the width and height of the textinput to fill the surrounding parent div.

Character Limit

A character limit may be imposed with the limit option.

char count: 0 / 300


Default

Here is some great help text.

Here is some great help text.

Here is some great help text.

Here is some great help text.

Disabled

This won't do anything, I think

This won't do anything, I think

Here is some great help text.

Here is some great help text.

Error

Fix please, thanks.

Fix bigly, thanks.

Fix please, thanks.

Fix please, thanks.

Events

Exposing some of the native JS events of the internal input field: focus and select

With suggestions



Custom themed

Don't stare too hard
src/components/Elements/Toggle/Toggle.jsx
Prop nameTypeDefaultDescription
animatebooltrue
baseClassstringbootstrapSwitch
bgColorOnstring
bsSizestringnull
defaultValuebooltrue
disabledboolfalse
handleWidthunionauto
One of type: string, number
inverseboolfalse
labelTextnode
labelWidthunionauto
One of type: string, number
offColorstringDefault
offTextnodeOFF
onChangefuncFunction
onColorstringPrimary
onTextnodeON
readonlyboolfalse
tristateboolfalse
valueboolundefined
wrapperClassstringwrapper

Button Options

Mini

ON OFF

Mini

ON OFF

Regular

ON OFF

Large

ON OFF

Custom Text

Wax On Wax Off

Label Text

ONThis is labelOFF

Disabled

ON OFF

Trigger Function

ON OFF

Override Color

ON OFF

Custom themed

ONHere we goOFF
src/components/Elements/Tooltip/Tooltip.jsx
Prop nameTypeDefaultDescription
childrennodeRequired
activeenumhover
One of: hover, trigger
ctaButtonshapenull
name: string
callback: func
dismissOnClickboolfalse

Dismiss by clicking on the tooltip itself

isModalboolfalse
messagestringPopover Rules
overridePlacementshapenull

Override for a placement and size of the tooltip, good for when tooltip will not move its spot yPos: translate Y, mandatory if use xPos xPos: translate X, mandatory if use yPos width: set width string of tooltip height: set height string of tooltip

yPos: number
xPos: number
width: string
height: string
positionenumtop
One of: top, bottom, left, right
scrollElementSelectorstringnull
timeoutnumber2000
titlestringnull

Tooltip

Boo i'm a ghost... Boooo...
Yeah Im a trigger popover but what of it guy. Click me to close me
View Contributions
This is a very long name, can we adjust this to fit in box but now lets keep this going, do we need a max characters
Arggh... I'm a goblin... argh...

Custom themed

Nice tooltip
Here's a tip: don't quit your day job!
src/components/Elements/TooltipMenu/TooltipMenu.jsx
Prop nameTypeDefaultDescription
childrennodeRequired
triggernodeRequired

Text, button, or any other element. This element will be displayed as the "trigger" for showing the tooltip. Clicking anywhere inside this element will show/hide the tooltip.

allowClickPropagationboolfalse

When enabled, click events for the trigger will propagate upwards to parent components

disableDismissMenuOnClickboolfalse

when true, menu will not dismiss on a selection of a menu click

menuOffsetXnumber0
menuOffsetYnumber0
onClickfuncFunction

a callback for when a menu option is clicked on. It will return the option's value prop

onMenuClosefuncFunction
overridePlacementshapenull
position: string
top: string
left: string
placementTooltipenumdefault

placementToolip to define where the tooltip will reside , includes arrow and container

One of: default, right
positionTooltipenumtop
One of: top, left
scrollElementSelectorstringnull

If the menu trigger is inside an element that scrolls, give a reference to the parent container so that scroll events can be handled correctly. This is a CSS selector.

showArrowbooltrue
toTheLeftToTheLeftboolfalse

Similar to the Dropdown component, the only allowable child for TooltipMenu are TooltipMenu.option. Pass any element to the trigger prop will display the passed element as a clickable area which, upon clicking, will show the menu:

// Pass a button to be displayed that a user can click on.
// no need to specify any onClick handlers.
const trigger = (
  <Button>
    Click me.
  </Button>
);
const MyComp = () => (
    <TooltipMenu trigger={trigger}>
        <TooltipMenu.option value="one">First option</TooltipMenu.option>
        <TooltipMenu.option value="two">Second option</TooltipMenu.option>
        <TooltipMenu.option value="three">Third option</TooltipMenu.option>
    </TooltipMenu>
);

Passing a custom method to onClick will invoke that method on option click, passing the supplied value prop as the only param.

The children of any Tooltipmenu.options can be any valid element.

Copy
Move
Download


Copy
Move
Download

The trigger prop can be any valid element:

Share
Copy link
Facebook
Twitter
Email

Other examples

I'm too long for comfort.
Me too. Way too much text.
Shorty McShorty


Copy link
Facebook
Twitter
Email

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla tincidunt finibus dui at scelerisque. Pellentesque tincidunt quam sit amet nisl mattis eleifend. Sed vitae dignissim nibh. Ut in suscipit ipsum. Donec placerat laoreet ante vel suscipit. Proin feugiat et est nec mollis. Phasellus scelerisque urna consectetur lectus euismod, a efficitur nunc fermentum. Suspendisse a purus vel enim bibendum fringilla ac et odio. Nulla facilisi.

Pellentesque pellentesque risus vel purus tristique, nec rhoncus lectus blandit. Nulla maximus fermentum augue, eget tempus nulla consectetur at. Nullam id ultricies purus. Mauris turpis augue, maximus eget tortor eu, commodo malesuada turpis. Nullam aliquam dictum urna, quis aliquet diam ultricies ac. Nam facilisis ullamcorper odio eu iaculis. Donec blandit eleifend velit nec condimentum.



Facebook
Twitter


Facebook
Twitter


Facebook
Twitter
Email

Custom themed

Copy link
Facebook
Twitter
src/components/Components/AudioPlayer/AudioPlayer.jsx
Prop nameTypeDefaultDescription
childrennodenull
onDeletefuncnull
onDownloadfuncnull
onEditfuncnull
showVolumeboolfalse
titlestring

Branded audio player and such.

all options enabled

Here is my awesome audio note, thanks.
00:00 / 00:00

no title

00:00 / 00:00

Toggling options

View mode
00:00 / 00:00
Edit mode
00:00 / 00:00

Child elements

Edit mode

Processing...

src/components/Components/CopyLinkButton/CopyLinkButton.jsx
Prop nameTypeDefaultDescription
buttonNamestringCopy link
confirmMessagestringURL copied
isModalboolfalse
onCopyfuncFunction
tooltipOverridePlacementshapenull
yPos: number
xPos: number
width: string
height: string
tooltipPosenumtop
One of: top, bottom, left, right
valuestringhttp://any/url/you/want.me

ShareLinkButton

Cheese Doodles
URL copied

Custom themed

URL copied
src/components/Components/Cropper/Cropper.jsx
Prop nameTypeDefaultDescription
srcstringRequired
aspectRationumberNaN
cancelButtonStylestringnormal
classNamestring
customClassNamestring
onCropEndfuncFunction
onCropSavefuncFunction

A call back method that will return the following: 1) image blob data from HTMLCanvasElement.toBlob(); 2) A references to the Cropper instance; 3) a data object. For crop, this will contain top, left, width, and height of the crop area. For rotate mode, it contains degrees rotated.

onCropStartfuncFunction
onRotatefuncFunction

This callback method is called after each rotation.

saveButtonStylestringprimary
Method nameParametersDescription
doRotate()

Programmatic way of performing rotation.

doCrop()

Programmatic way of starting crop mode.

Crop and Rotate image functionality. And stuff.

Note: There is no server-side backend to dynamically update the image for this demo; the image will not be saved when switching between modes.

crop rotate this
src/components/Components/DragSortTable/DragSortTable.jsx
Prop nameTypeDefaultDescription
childrennodeRequired
isOpenboolRequired
onRequestClosefuncRequired
allowTitleSortbooltrue
classNamestring
headerDescriptionTextstringDrag rows and hit save
headerTitleTextstringTitle
isLoadingboolfalse
itemsunknown[]
modalTitlestringRearrange
onClickSavefuncFunction
prefixRowscustom[][]
showThumbnailbooltrue
sizeenumlarge
One of: default, large
suffixRowscustom[][]

Well now.

src/components/Components/GridItem/GridItem.jsx
Prop nameTypeDefaultDescription
actionBarItemsshape[][]

An array contain ActionBar.option props, in the following format:

value: stringValue pass via onClick callback
iconClass: stringActionBar item icon
highlighted: boolActionBar highlight of selection
disabled: boolActionBar disabling of selection
label: stringActionbar item text
href: stringActionbar add href to make button an anchor tag
actionBarPropsshapeShape

Props to be passed to the internal ActionBar component

optionsToShow: number
onClick: func
textAlign: enum
moreText: string
moreIconClass: string
addWarningIconboolfalse

AARP Confetti Warning Icon

altDesignbooltrue

Alternative GridItem design, with elements rearranged from default

altMediaNamestringmedia

alternate name for the grid content

appendChildrennodenull

any other components to append to the bottom of the grid item

baseClassNamestring
borderColorstringnull
classNamestring
clickableGridItemboolfalse

attribute basically that the whole grid item is clickable and gives curser: pointer value

columnSpacingnumber10

Space between columns, in pixels

columnSpannumber1
customOverlaynodenull
dividerColorstringnull
dividerWidthnumber0
draggableboolnull
draggablePrefixAdditionsnodeundefined
draggableTextstringDrag Me
forceRowHeightstringnull
iconClassstring

Fortawesome classes for icons that appear in top right. Multiple icons separated by a space

imagePrefixAdditionsnodeundefined
imageUrlstringhttps://www.enwoven.com/assets/default-project-thumb.png

url for the preview thumbnail

imageUrlAnchorstringnull

creates an anchor tag of the surrounding image USED for right clicking

inPlaceDragDropboolfalse
isPreviewboolfalse
labelstring
noHoverEffectboolfalse

disables accent color for paragraph text at the bottom of the grid item and sets cursor to default arrow so people don't expect a link there

noOverlayboolfalse
onDragfuncFunction
onDragStartfuncFunction
onDragStopfuncFunction
onImageClickfuncFunction
onOverlayClickfuncFunction
onTitleClickfuncFunction
overlayTextstring

Text that appears in top left of thumbnail on hover

preserveImageAspectRatioboolfalse

by default, images are stretched to fille available space. Use this to preserve that sweet aspect ratio.

rowSpacingnumber-1
rowSpannumber1
showActionsbooltrue
showStackItemboolfalse
showTitlebooltrue

Show/Hide the title area completely.

titleTextunion

Text that appears on bottom-most area of grid item.

One of type: string, node
wildboolfalse

cray cray af, fam

Okay guys and gals, it's a Grid Item.

12 views
media
View
Edit
Donec rutrum eu arcu sit amet suscipit Proin sodales massa non sem convallis dapibus
12 views
media
View
Edit
Star
Donec quis facilisis metus Nam at rutrum mauris
12 views
media
View
Edit
Copy
  More
Move
Donec eu est est Nam at rutrum mauris
12 views
media
Yes
No
Copy
  More
Move
Sed tincidunt lorem ut gravida malesuada Etiam porta eros a dolor posuere posuere
12 views
media
View
Select
Maecenas sollicitudin pretium mattis Donec rutrum eu arcu sit amet suscipit
12 views
media
Like (3)
Copy
  More
Move
Fusce eu condimentum ipsum, vel lacinia ipsum Nullam nibh quam, tincidunt ut condimentum id, tincidunt non nisl
12 views
media
View
In mi lectus, fermentum fringilla lectus eget, consequat condimentum massa Cras vehicula lacus in lorem semper, sit
amet vestibulum nunc pretium
12 views
media
View
Add
  More
View
Add
View
Add
Vestibulum sed mauris magna Nullam nibh quam, tincidunt ut condimentum id, tincidunt non nisl

Optional title and action bar, columns, etc.

12 views
media
View
Edit
12 views
media
An Anchor Title
!!TUW
media
Nothing going on here...
media
media

onImageClick with no overlay

When no overlay is present, you may optionally supply a callback to onImageClick.

media
Okay
src/components/Components/IconButton/IconButton.jsx
Prop nameTypeDefaultDescription
onClickfuncRequired
buttonNamestringIs Button
disabledboolfalse
iconClassstringfa-plus
sizeenumnormal
One of: normal, large

Icon Button Divider

Custom themed

src/components/Components/PageProgressBar/PageProgressBar.jsx
Prop nameTypeDefaultDescription
cylonbooltrue
maxnumber100
offsetTipXnumber0

X-coord offset for the tooltip, to adjust its position further

offsetTipYnumber0

Y-coord offset for the tooltip, to adjust its position further

onPageChangefuncFunction
resetTooltipOriginboolfalse

Zero out the top and left origin of the page number Tooltip

valuenumber1

Page Progress Bar

Note: Since Page Progress Bar internally uses a themed version of Progress Bar, it needs to be wrapped externally by a ThemeProvider.

0
1
30
Mobile Version
0
1
30


src/components/Components/TagInput/TagInput.jsx
Prop nameTypeDefaultDescription
onAddTagfuncRequired

Callback when tag has been added

onChangefuncRequired

onChange callback from input field

onDeleteTagfuncRequired

Callback when removing a tag

valuestringRequired
caseSensitiveboolfalse

When adding a new tag, whether checks should be case sensitive

disabledboolfalse

disabled input

focusTimeoutnumber0

Optional override of the timeout interval to regain focus on the input

labelstringlabel
namestringtaginput
onBlurfuncFunction
onFocusfuncFunction
placeholderstringTag Input

placeholder of the input

savingTxtstring

top right placement normally used for saving indicator

suggestedTagsshape[][]

dropdownList is an array of tags. This appears beneath the input to display search results. Tags are objects in the following form:

label: string
value: string
tagsshape[][]

Tags is an array of tags. Tags are objects in the following form:

label: string
value: string
Saving...
src/components/Layouts/Grid/Grid.jsx
Prop nameTypeDefaultDescription
childrennodeRequired
classNamestring
columnSpacingnumber10
columnSpannumber1
ddThrottlebooltrue

Don't set this to false unless you know what you're doing.

dividerWidthnumber0
draggableboolfalse
forceColumnCountnumber0
forceRowHeightstringnull
highlightDropWidthnumber4
inPlaceDragDropboolfalse
labelsstring[]null
onDragStopfuncFunction

Callback when a drag event is done, passing in an object with before and after arrays of the GridItems

onResizefuncFunction
rowSpacingnumber10
rowSpannumber1
useFlexLayoutboolfalse

A Grid layout accepts one or more grid items and places them into columns and rows depending on the layout's avaiable width.

Responsiveness

Resize to your heart's content. Columns are determined by container pixel width:

smallmediumlargex-large
Width< 768px>= 768px>= 992px>= 1200px
Columns2346

Calculated width: 0px, columns: 0


Dividers and labels

Drag and Drop / Sorting


Custom grid item contents


Force row height

(I'm empty)

(I'm empty)

Theme structure and usage

A theme is a plain javascript object. It takes the following format:

{
    colors: {
        primaryColorLight: "var(--knotty-primary-color-light)",
        primaryColor: "var(--knotty-primary-color)",
        primaryColorDark: "var(--knotty-primary-color-dark)",
        greyLight: "#f3f6f9",
        grey: "#a5a5a5",
        greyDark: "#2e2e2e",
        error: "#c02519",
    },
    typography: {
        primaryFont: "'Open Sans', sans-serif",
    },
    Button: {/*... button-related properties ... */},
    Checkbox: {/*... checkbox-related properties ... */},
    /* ... etc, */
}

knotty providers a default theme to show you what values can be overridden. You can use a theme by simply importing:

// internally, inside knotty.
import { themes, } from 'themes';

// inside THP-V3... soon :)
import { themes, } from 'features/dls';

// access the default theme:
const defaultTheme = themes.default;

Using themes

All knotty components will use the default theme if none is explicitly provided. To use a different theme, you must provide it with the ThemeProvider component, as follows:

import React from 'react';
import { render, } from 'react-dom';
import { ThemeProvider, themes, } from 'features/dls';
import { MyIndexView, } from 'my-app';

render(
    <ThemeProvider theme={themes.default}>
        <MyIndexView />
    </ThemeProvider>,
    document.getElementById('root')
);

ThemeProvider does not need to be a top-level component; however, only components which are children of ThemeProvider will pick up on the provided theme.

This example above explicitly uses the default theme (a little redundant), but merely demonstrates how to supply a specific theme. See below for how to customize or create your own theme.

Providing a custom theme for a single component

Sometimes Ben or Ana want a slightly different shade of fuschia for one button on one page. Who are we to deny them?! Create a custom themed button with the withCustomTheme higher order component:

import { ThemeProvider, withCustomTheme, } from 'features/dls';

const MyCustomThemedButton = withCustomTheme(Button, {
    fontSize: '24px',
    backgroundColor: '#ff00ff',
    color: 'white',
    minHeight: '64px',
});

Example as follows:



Any component that uses a custom theme must be a child of ThemeProvider (nested or otherwise).

Making your own themes

Using withCustomTheme HOC works well if you need a one-off override for particular components. But suppose you need to make some more extensive changes which will affect all components, such as changing the primary-color, or primary font.

In these cases, you would need to create a custom theme and pass it into the top-level ThemeProvider theme's prop. Create custom themes by using the provided createTheme function:

import { ThemeProvider, createTheme, themes, } from 'features/dls';

const customTheme = createTheme(
    { primaryColor: '#0000ff' },
    { primaryFont: 'Times New Roman', },
    {
        Button: {
            normal: {
                borderColor: 'blue',
                borderWidth: '6px'
            }
        }
    }
);
<ThemeProvider theme={customTheme}>
    <React.Fragment>
        <Button buttonStyle="primary">I'm changed.</Button><br /><br />
        <Button buttonStyle="primary">Wow! I changed too.</Button>
        <Button buttonStyle="normal">Normal!</Button>
    </React.Fragment>
</ThemeProvider>

createTheme() accepts three arguments: colors, typography, and overrides.

All arguments are optional (but why would you do that?!). Take a look at what themes.default looks like to see what key/values can be overridden.

The third argument, overrides, is a plain javascript object that can be used to ...override any other parts of the default theme. Example of this is below, but more on this later.

Any key-value pairs you do not provide will automatically be inherited from the default theme.





Adding custom values, inheriting, referencing theme values internally

The overrides argument can also be useful for overwriting select properties as needed. For example, let's say that you want to create a theme that will override a primary button's border width property (for all instances of Button component):

const customTheme = createTheme(
    themes.default.colors,
    themes.default.typography,
    {
        Button: {
            primary: {
                borderWidth: '12px'
            }
        }
    }
);

This will override a single property. As mentioned previously, all other default theme properites will be inherited.

Let's suppose you don't want to override any existing colors or typography, but just want to add something like a new color or property (to be used later). This can be achieved as follows:

// Method 1: just add some new custom values. all other key-value pairs, such as primaryColor, will be inherited
const myCustomTheme1 = createTheme(
    {
        myFoofColor: '#ff00ff', 
        burntSienna: '#e97451',
        purpleDrank: '#6633ff',
    },
    {
        eyeballBlastFont: 'Comic Sans MS',
    }
);

// Method 2: you can add any custom properties to third `overrides` argument:
const myCustomTheme2 = createTheme(
    {
        myFoofColor: '#ff00ff', 
        burntSienna: '#e97451',
        purpleDrank: '#6633ff',
    },
    {
        eyeballBlastFont: 'Comic Sans MS',
    },
    {
        subtleBorder: '100px solid #ff00ff',
        reusableShadowValue: '0 0 5px rgba(0,0,0,0.5)',
    }
);

You can reference newly added custom values (or any other theme values) by providing a string value that will resolve to the property. Let's say I want the primary button to reference some newly added custom properties:

const customTheme = createTheme(
    {
        myFoofColor: '#ff00ff', 
    },
    {
        eyeballBlastFont: 'Comic Sans MS',
    },
    {
        anotherCustomColor: '#6633ff',
        superFatBorderWidth: '100px',
        Button: {
            primary: {
                color: 'colors.foof',
                primaryFont: 'typography.eyeballBlastFont',
                borderWidth: 'superFatBorderWidth',
                hover: {
                    backgroundColor: 'anotherCustomColor',
                }
            }
        }
    }
);

Any custom properties can even be used by components that were created with withCustomTheme HOC, as follows:

const customTheme = createTheme(
    { foof: '#ff00ff', reallyblue: '#0000ff' },
);

const MyCustomThemedButton = withCustomTheme(Button, {
    fontSize: '22px',
    backgroundColor: 'colors.reallyblue',
    color: 'colors.foof',
});

<ThemeProvider theme={customTheme}>
    <React.Fragment>
        <Button>Normal button</Button><br /><br />
        <MyCustomThemedButton>Soo blue and foofy</MyCustomThemedButton>
    </React.Fragment>
</ThemeProvider>


Accessing current theme

If you need to access the current theme, it can be provided as a local prop with the withThemeProp HOC:

import { withThemeProp } from 'features/dls';

class MyComponent extends React.Component {
  render() {
      console.log(this.props.theme);
      //--- render, render, render, 
  }
}
export default withThemeProp(MyComponent)