Naboar is a UI component library built for React apps using typescript.

install these peer deps.

"peerDependencies": {
    "react": "^16.4.0",
    "react-dom": "^16.4.0",
    "styled-components": "^4.1.3"
  }

Install the components

npm install --save naboar

Wrap app in Themer, and pass it an optional theme object with overrides to the default theme.

The default theme is found here

import { Themer } from 'naboar'

function App() {
  return (
    <Themer theme={yourTheme}>
      {/* your app here */}
    </Themer>
  )
}

All of the components

src/components/Badge/Badge.tsx

Badge Component

Author: Daniel Serrano

Since: v1.0.0

Prop nameTypeDefaultDescription
childrenanyRequired

Text displayed inside of the badge

canCloseboolean

Toggle Badge close option

classNamestring

The class name

cssFlattenSimpleInterpolation | FlattenInterpolation<any>

CSS styling using css from styled-components

disabledboolean

Toggle badge clickability

onClose(e?: any) => void

On Close click

themeITheme

Theme

Badge
Badge
Badge
Badge
Badge
Badge
Badge
Badge
Badge
Badge
Badge
Badge
Badge
Badge
src/components/Button/Button.tsx

Button Component

Author: Jonathan Currie

Since: v1.0.0

Prop nameTypeDefaultDescription
childrenanyRequired

component children

classNamestring

The class name

cssFlattenSimpleInterpolation | FlattenInterpolation<any>

CSS styling using css from styled-components

disabledboolean

disabled attribute

isActiveboolean

active if Button value matches ButtonGroup activeValue

namestring

Name for javascript reference or form-data

onClick(e: any) => void

onClick callback

themeITheme

Theme

typeButtonTypessubmit

specify button type

valuestring

value attribute

src/components/ButtonGroup/ButtonGroup.tsx

ButtonGroup Component

Author: Jonathan Currie

Since: v1.0.0

Prop nameTypeDefaultDescription
activeValuestring | numbernull
childrenanyRequired

Button Group Child

classNamestring

The class name

cssFlattenSimpleInterpolation | FlattenInterpolation<any>

CSS styling using css from styled-components

themeITheme

Theme

src/components/Checkbox/Checkbox.tsx

Checkbox Component

Author: Anthony Freda

Since: v1.0.0

Prop nameTypeDefaultDescription
namestringRequired

Name of form element

checkedboolean

whether or not the box is checked

disabledboolean

toggle active state of input

errorMessagestring | boolean

errorMessage

labelstring

Text label

onChange(newVal?: boolean, e?: ChangeEvent<HTMLInputElement>) => void

on click called with opposite of current val and event obj

Example:

src/components/Datalist/Datalist.tsx

Datalist Component

Author: Jonathan Currie

Since: v1.0.0

Prop nameTypeDefaultDescription
childrenanyRequired

children - Option Array

onChange(e: any) => void

onChange - same event handler as input

Example:

error message here...

src/components/DatePicker/DatePicker.tsx

DatePicker Component

Author: Anthony Freda

Since: v1.0.0

Prop nameTypeDefaultDescription
namestringRequired

Name of form element

onChange(since: Date, until?: Date) => voidRequired

function called when any date is changed

sinceNamestringsince

override default since name

untilNamestringuntil

override default until name

classNamestring

The class name

cssFlattenSimpleInterpolation | FlattenInterpolation<any>

CSS styling using css from styled-components

errorMessagestring | boolean

errorMessage

isRangePickerboolean

does it have a since and until

isTimePickerboolean

Can the user select a time

labelstring

Text label

outlineboolean

should inputs be outline

sinceDate

Date object for since or single date

sinceRequiredboolean

is since required

themeITheme

Theme

untilDate

Date object for until

untilRequiredboolean

is until required

Example




src/components/ErrorModal/ErrorModal.tsx

ErrorModal Component

Author: Daniel Serrano

Since: v1.0.0

Prop nameTypeDefaultDescription
messagestringRequired

Message of ErrorModal

titlestringRequired

Title of ErrorModal

onClick(e?: any) => void

On Click for ErrorModal button

src/components/FormElementError/FormElementError.tsx

FormElementError Component

Author: Tracey King

Since: v1.0.0

Prop nameTypeDefaultDescription
errorstring | booleanRequired

Text for label

classNamestring

The class name

cssFlattenSimpleInterpolation | FlattenInterpolation<any>

CSS styling using css from styled-components

themeITheme

Theme

src/components/Icon/IconIOS/IconIOS.tsx

Icon IOS Component

Author: Tracey King

Since: v1.0.0

Prop nameTypeDefaultDescription
nameiOSRequired

Ionicon icon name

classNamestring

The class name

colorstring

Color of icon

cssFlattenSimpleInterpolation | FlattenInterpolation<any>

CSS styling using css from styled-components

onClick(e: any) => void

Event fired on click

sizenumber

Size of font in px

themeITheme

Theme

src/components/Icon/IconLogo/IconLogo.tsx

Icon Logo Component

Author: Tracey King

Since: v1.0.0

Prop nameTypeDefaultDescription
namelogoRequired

Ionicon icon name

classNamestring

The class name

colorstring

Color of icon

cssFlattenSimpleInterpolation | FlattenInterpolation<any>

CSS styling using css from styled-components

onClick(e: any) => void

Event fired on click

sizenumber

Size of font in px

themeITheme

Theme

src/components/Icon/IconMD/IconMD.tsx

Icon Material Component

Author: Tracey King

Since: v1.0.0

Prop nameTypeDefaultDescription
namemdRequired

Ionicon icon name

classNamestring

The class name

colorstring

Color of icon

cssFlattenSimpleInterpolation | FlattenInterpolation<any>

CSS styling using css from styled-components

onClick(e: any) => void

Event fired on click

sizenumber

Size of font in px

themeITheme

Theme

src/components/Input/Input.tsx

Input Component

Author: Tracey King

Since: v1.0.0

Prop nameTypeDefaultDescription
namestringRequired

Name of form element

autoFocusboolean

Toggles input Focus

canClearboolean

Toggle input clear option

classNamestring

The class name

cssFlattenSimpleInterpolation | FlattenInterpolation<any>

CSS styling using css from styled-components

disabledboolean

Toggle input clickability

errorMessagestring | boolean

errorMessage

iconNameiOS

Name of left icon

labelstring

Text label

liststring

Target datalist with same id

maxnumber

Maximum value for number input

minnumber

Minimum value for number input

onChange(value: any) => void

On Change callback

onClear() => void

On Clear click

onClick(e?: any) => void

On Click callback

outlineboolean

Should the input be of the outline variant

requiredboolean

is this input required

themeITheme

Theme

typestring

Type of input field

valuestring

Value of input field

Please enter an email address

src/components/Label/Label.tsx

Label Component

Author: Tracey King

Since: v1.0.0

Prop nameTypeDefaultDescription
htmlForstringRequired

For attribute for input targeting

textstringRequired

Text for label

classNamestring

The class name

cssFlattenSimpleInterpolation | FlattenInterpolation<any>

CSS styling using css from styled-components

themeITheme

Theme

src/components/Message/Message.tsx

Message Component

Author: Daniel Serrano

Since: v1.0.0

Prop nameTypeDefaultDescription
messagestringRequired

Message of Message

onClose(e?: any) => void

On Click for Message button

...THIS IS A STOCK MESSAGE... Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam interdum sapien non fringilla mattis.


...THIS IS A ERROR MESSAGE... Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam interdum sapien non fringilla mattis.


....THIS IS A MAIN MESSAGE.... Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam interdum sapien non fringilla mattis.


...THIS IS A SUCCESS MESSAGE... Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam interdum sapien non fringilla mattis.


...THIS IS A WARNING MESSAGE... Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam interdum sapien non fringilla mattis.

src/components/Notifications/Notifications.tsx

Notifications Component

  • Ask for push notifications permission
  • If permission granted use native notifications
  • If not use a custom in browser solution ones

Author: Anthony Freda

Since: v1.0.0

Prop nameTypeDefaultDescription
notificationsINotification[]Required

Array of INotification[]

nativeboolean

Use Native push notifs

onClick(e?: any, i?: number) => void

Called when notif is clicked

onClose(e?: any, i?: number) => void

Called when close button is clicked

onError(e?: Event) => void

Called when error making notif

Example

src/components/Pagination/Pagination.tsx

Pagination Component

Used for long lists and tables

Author: Anthony Freda

Since: v1.0.0

Prop nameTypeDefaultDescription
onClick(page?: number, e?: any) => voidRequired

called with selected page and event

pagenumber1

current page

pageCountnumber1

amount of pages to control

palette"outline" | "fill"undefined

predefined theming for pagination components

firstTextReactNodeFirst

text for first control

lastTextReactNodeLast

text for last control

maintainSkipWidthboolean

maintain the amount of pages on both sides

nextTextReactNode

text for next control

pageSkipnumber1

amount of pages displayed

prevTextReactNode

text for previous control

showEllipsesbooleanfalse

should ellipses be rendered for long amounts

showFirstbooleanfalse

should first page num always be rendered

showLastbooleanfalse

should last page num always be rendered

Example

  • 1
  • 2
  • 10
src/components/Radial/Radial/Radial.tsx

Radial Menu Component

Takes children of type <RadialMenuItem />

Author: Anthony Freda

Since: v1.0.0

Prop nameTypeDefaultDescription
childrenReactElement<IItemProps, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)>) | (new (props: any) => Component<any, any, any>)>[] | ... 6 more ... | (ReactPortal & ReactElement<...>[])Required

Array of Radial Items

coords{ left?: number; top?: number; bottom?: number; right?: number; }

Css position obj

defaultActiveboolean

Is it open by default

onClick() => void

Called on button click

onClose() => void

Called on button click to close

onOpen() => void

Called on button click to open

Example

src/components/Radial/RadialMenuItem/RadialMenuItem.tsx

Radial Menu Item Component

To be implmented as a child of <Radial />

Author: Anthony Freda

Since: v1.0.0

Prop nameTypeDefaultDescription
iconNameiOSRequired

IOS icon name to be displayed in button

titlestringRequired

Title displayed on hover

onClick(event: MouseEvent<HTMLButtonElement, MouseEvent>) => void

Event fired on click of button

Example

See Radial doc

src/components/Radio/Radio.tsx

Radio Component

Author: Anthony Freda

Since: v1.0.0

Prop nameTypeDefaultDescription
namestringRequired

Name of form element

valuestring | numberRequired

value

checkedboolean

whether or not the box is checked

disabledboolean

toggle active state of input

errorMessagestring | boolean

errorMessage

labelstring

Text label

onChange(value?: string | number, e?: ChangeEvent<HTMLInputElement>) => void

on click called with value

Example:

src/components/Select/Select.tsx

Select Component

Author: Tracey King

Since: v1.0.0

Prop nameTypeDefaultDescription
namestringRequired

Name of form element

childrenany[]

Children must be HTMLOptionElements

classNamestring

The class name

cssFlattenSimpleInterpolation | FlattenInterpolation<any>

CSS styling using css from styled-components

errorMessagestring | boolean

errorMessage

labelstring

Text label

onChange(e?: any) => void
onClick() => void

Fired on click

outlineboolean

should outline variant

themeITheme

Theme

valuestring | number

called when input changes

src/components/Slider/Slider.tsx

Slider Component

Author: Anthony Freda

Since: v1.0.0

Prop nameTypeDefaultDescription
namestringRequired

Name of form element

onChange(val: number) => voidRequired

Called with new value of slider

valuenumber0

Value of slider

errorMessagestring | boolean

errorMessage

labelstring

Text label

maxnumber100

Maximum possible value of slider

minnumber0

Minimum possible value of slider

stepnumber1

Skip amount of slide

Example

Value: 0

Value: 0

src/components/Spinner/Spinner.tsx

Datalist Component

Author: Jonathan Currie

Since: v1.0.0

Prop nameTypeDefaultDescription
classNamestring

The class name

cssFlattenSimpleInterpolation | FlattenInterpolation<any>

CSS styling using css from styled-components

themeITheme

Theme

src/components/Switch/Switch.tsx

Message Component

Author: Daniel Serrano

Since: v1.0.0

Prop nameTypeDefaultDescription
isOnbooleanRequired

Is On for Switch

onClick(e?: any) => void

On Click for Switch

src/components/Table/Table.tsx

Table Component

Author: Anthony Freda

Since: v1.0.0

Prop nameTypeDefaultDescription
columnsICell[]Required

List of columns, either strings or cells with config options. Documented below

onSelectChange(e?: any) => voidRequired

called when custom select option is clicked

canClearSearchboolean

boolean can clear seach

controlsCssFlattenSimpleInterpolation | FlattenInterpolation<any>

controls container css

dataIObj[] | []

An array of objects all containing keys that match up to the defined columns

limitReactText

current limit

onAllCheckboxes() => void

called when top level checkbox is clicked

onCheckbox(val: boolean, cellIndex: number) => void

called when checkbox cell is changed

onClearSearch(value: null) => void

called when search input is cleared

onDateChange(since: Date, until: Date) => void

called on date change

onLimitChange(limit: ReactText) => void

called when limit is updated

onRowClick(cell?: IObj, cellIndex?: number) => void

called when cell is clicked

onSearchChange(e: any) => void

called when search input is updated

onSort(key?: string, order?: "asc" | "desc") => void

called with key and order

onUpdatePage(page: number) => void

called on page number click

order"asc" | "desc"

order to sort key by

pagenumber

current page

pageCountnumber

total number of pages

paginationCssFlattenSimpleInterpolation | FlattenInterpolation<any>

pagination container css

paginationTheme"outline" | "fill"

theme for pagination components

searchPlaceholderstring

search field placeholder

selectLabelstring

custom select label

selectList{ key?: string; text: string; value: string; }[]

dropdown list

selectValueany

value shown in select dropdown

showCustomSelectboolean

whether or not to show a custom select filter

showDatePickerboolean

whether or not to render datepicker component

showLimitboolean

whether or not to show limit selection

showPaginationboolean

whether or not to render the pagination component

showSearchboolean

whether or not to render search input

showToolbarLabelsbooleantrue

show toolbar labels

sinceDate

current since value

sortstring

key to sort by

termstring

search input current value

toolbarTheme"outline" | "fill"fill

toolbar theming

untilDate

current until vlue

IObj
interface IObj {
  [key: string]: any
}
ICell
interface ICell {
  key: string
  heading?: string
  /** Function that returns your own custom <Th /> */
  renderHeading?: (
    heading: string,
    index?: number,
    col?: ICell,
  ) => ReactElement<any>
  /** Function that returns your own custom <Td /> */
  renderCell?: (
    cell: string,
    index?: number,
    data?: Obj[],
    col?: ICell,
  ) => ReactElement<any>
  onClick?: (...args: any[]) => void
  isChecked?: boolean | null | undefined
  isSortable?: boolean
}

Example

Basic Usage:

headerTest
headerTest
headerTest
headerTest
headerTest
headerTest
headerTest
testtesttesttesttesttesttest
testtesttesttesttesttesttest
testtesttesttesttesttesttest
testtesttesttesttesttesttest

With Controls:

headerTest
headerTest
headerTest
headerTest
headerTest
headerTest
headerTest
testtesttesttesttesttesttest
testtesttesttesttesttesttest
testtesttesttesttesttesttest
testtesttesttesttesttesttest
src/components/Tabs/TabItem/TabItem.tsx

TabItem Component

Author: Anthony Freda

Since: v1.0.0

Prop nameTypeDefaultDescription
childrenReactNodeRequired

Tab content

keystringRequired

unique identifier for TabItem

titlestringRequired

Title of tab

isDisabledboolean

Is this tab disabled

Example

See Tabs doc

src/components/Tabs/Tabs/Tabs.tsx

Tabs Component

Takes children of type <TabItem />

Author: Anthony Freda

Since: v1.0.0

Prop nameTypeDefaultDescription
childrenReactElement<ITabItemProps, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)>) | (new (props: any) => Component<any, any, any>)>[]Required

Tab content

activeKeystring

Active key

classNamestring

The class name

cssFlattenSimpleInterpolation | FlattenInterpolation<any>

CSS styling using css from styled-components

onChange(key: string) => void

Function called with new key

themeITheme

Theme

Example

I am a tab 1
I am a tab 2
I am a tab 3
I am a tab 4
src/components/Textarea/Textarea.tsx

Textarea Component

Author: Tracey King

Since: v1.0.0

Prop nameTypeDefaultDescription
namestringRequired

Name of form element

classNamestring

The class name

cssFlattenSimpleInterpolation | FlattenInterpolation<any>

CSS styling using css from styled-components

errorMessagestring | boolean

errorMessage

labelstring

Text label

onChange(e?: any) => void

Fired onChange event

rowsnumber
themeITheme

Theme

valuestring
variant"primary" | "secondary" | "tertiary"

Please enter a description

src/components/Tooltip/Tooltip.tsx

Tooltip Component

Author: Tracey King

Since: v1.0.0

Prop nameTypeDefaultDescription
position"top" | "bottom" | "left" | "right"Required
classNamestring

The class name

cssFlattenSimpleInterpolation | FlattenInterpolation<any>

CSS styling using css from styled-components

textstring
themeITheme

Theme

Testing the titleExample tooltip text Example tooltip text Example tooltip text Example tooltip text Example tooltip text Example tooltip text Example tooltip text Example tooltip text Example tooltip text Example tooltip text Example tooltip text Example tooltip text
something

else

hello

src/components/Wizard/Wizard/Wizard.tsx

Wizard Component

Author: Anthony Freda

Since: v1.0.0

Prop nameTypeDefaultDescription
childrenReactElement<IStepProps, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)>) | (new (props: any) => Component<any, any, any>)>[] | ... 6 more ... | (ReactPortal & ReactElement<...>[])

Children of type <WizardStep />

classNamestring

The class name

completeTextstringComplete

Text in complete button

controlsstring | number | boolean | {} | ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)>) | (new (props: any) => Component<any, any, any>)> | ReactNodeArray | ReactPortal | ReactNode[]

Content displayed in bottom left of wizard

cssFlattenSimpleInterpolation | FlattenInterpolation<any>

CSS styling using css from styled-components

nextTextstringNext

Text in next button

onComplete() => voidnull

function called when wizard is completed

onNext() => voidnull

function called when index increases

onPrevious() => voidnull

function called when index decreases

previousTextstringPrevious

Text in previous button

shouldShowTimelinebooleantrue

should the timeline be displayed

themeITheme

Theme

validation{ [key: string]: boolean[]; }{}

objects keyed with the names of steps, array of boolean vals

1

Do some stuff 1

2

Do some stuff 2

3

Review

Do some stuff 1

Do some stuff 2

Value 1:
Value 2:
src/components/Wizard/WizardStep/WizardStep.tsx

Wizard Step Component

Expacted child of <Wizard />

Author: Anthony Freda

Since: v1.0.0

Prop nameTypeDefaultDescription
childrenReactNodeRequired

Can be anything

namestringRequired

key for validation

titlestringRequired

Title to be displayed on pane

hideTitleboolean

Should the title be displayed on the pane

timelineTitlestring

Title to be displayed on top bar

Example

See Wizard doc

Animation components

src/effects/Expand/Expand.tsx

Expand Component transition from width || height px to px

Author: Anthony Freda

Since: v1.0.0

Prop nameTypeDefaultDescription
childrenReactNodeRequired

One or more elements

fromnumberRequired

width or height(px)

tonumberRequired

width or height(px)

classNamestring

The class name

cssFlattenSimpleInterpolation | FlattenInterpolation<any>

CSS styling using css from styled-components

isExpandedboolean

Whether or not the component is at full width/height

themeITheme

Theme

verticalboolean

Should it expand in height

Example

Hello


Hello


src/effects/Fade/Fade.tsx

Fade Component Fades in a component

Author: Anthony Freda

Since: v1.0.0

Prop nameTypeDefaultDescription
childrenReactNodeRequired

One or more elements

distancenumberRequired

How far off is the component

fromfooRequired

The direction it fades from

classNamestring

The class name

cssFlattenSimpleInterpolation | FlattenInterpolation<any>

CSS styling using css from styled-components

shouldShowboolean

Whether or not the component is at full width/height

themeITheme

Theme

Example

From Left


From Right


Data viz components

src/viz/BulletChart/BulletChart.tsx

BulletChart Component

Bullet Chart

Author: Anthony Freda

Since: v1.0.0

Prop nameTypeDefaultDescription
maxnumber100

maximum number for chart

scale{ color: string; amount: number; borderColor?: string; }[]Required

Array of objects that dictate the sections and colors of the chart

amountnumber

value used to render center bar of chart

amountColorstringwhite

color of amount bar

labelReactNode

label for right side of chart

metricstring

metric for chart(%, ft, yards)

scaleTicksnumber5

how many ticks should be rendered

targetnumber

target number, rendered as vertical line in chart

targetColorstringwhite

color of target line

Example:

Awesome% of awesome
020406080100
Amount: 90Target: 85

Rainbowcolors
020406080100
Amount: 90

GreyscaleBrightness
020406080100120140160180200
Amount: 130