0.12.14 • Published 5 years ago

webdep-react-controls v0.12.14

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

webdep-react-controls

React wrappers for form controls

installation

Using npm:

npm install webdep-react-controls --save

Using yarn:

yarn add webdep-react-controls

Styles

You should import styles separately from webdep-react-controls/build/lib/styles.css, or, if You using sass in your project, just add @import "~webdep-react-controls/src/lib/styles/styles.scss"

Components documentation

You can find detailed documentation for components in webdep-react-controls/build/docs/index.html.

Components

Button

Button component is simple wrapper for regular button.

Customization

To customize button styles just write styles from wrc-button class, or you can overwrite some sass variables:

$btn-font-size, $btn-darken-percentage, $btn-lighten-percentage, $button-border-radius, $button-border-style, button-border-width, $link-color, $link-color-hover, $link-color-disabled,

Props

NameTypeDefault ValueDescription
disabledPropTypes.boolIs button disabled
typePropTypes.oneOf('button', 'submit', 'link', 'label')'button'Button type
statePropTypes.oneOf('primary', 'secondary', 'success', 'danger', 'warning', 'info', 'light', 'dark', 'link')'primary'responsible for button background
sizePropTypes.oneOf('small', 'medium', 'big',)'medium'Button size
onClickPropTypes.funcButton click callback

Card

Dialog

Input

Paginator

Select

Customized select control. It has options list, which appends to top of dom tree by createPortal function.

Customization

To customize select styles just write styles from wrc-select class, or you can overwrite some sass variables:

$options-list-max-height, $select-list-max-height, $select-height, $select-background-color, $options-list-background-color, $options-list-border-color, $options-border-width, $options-list-border-top-left-radius, $options-list-border-top-right-radius, $options-list-border-bottom-left-radius, $options-list-border-bottom-right-radius, $option-padding, $option-color, $option-border-bottom, $option-focused-color, $option-focused-bg, $option-selected-color, $option-selected-bg, $dropdown-z-index

Props

NameTypeDefault ValueDescription
optionsPropTypes.arraySelect options list
enableSearchPropTypes.boolIf it is true, then search input will be displayed
optionNameFnPropTypes.funcFunction to customize displaying select options in options list
nameAccessorPropTypes.string'name'If don't use optionNameFn, nameAccessor shold be key of option Name
valueAccessorPropTypes.string'id'Key, which contain value of option object
triggerClassNamePropTypes.stringClass name of div, which display select placeholder or selected value
optionsListClassNamePropTypes.string'wrc-select__options-list'
searchFnPropTypes.funcFunction, which get search input value, current option and select props, which should return true if option satisfies the search conditions

Table

Tooltip

Use tooltips for displaying some addition information, validation messages, e.t.c

Customization

To customize tooltip styles just write styles from wrc-tooltip class, or you can overwrite some sass variables:

$tooltip-border-radius, $tooltip-z-index, $tooltip-padding, $tooltip-caret-botder

Props

NameTypeDefault ValueDescription
positionPropTypes.oneOf('top', 'bottom', 'right', 'left')'top'Is tooltip on top or on bottom from target
statePropTypes.oneOf('primary', 'secondary', 'success', 'danger', 'warning', 'info', 'light', 'dark', 'link')'dark'Tooltip background color
bodyropTypes.oneOfType(PropTypes.string, PropTypes.object, PropTypes.func)Tooltip message
bodyStylePropTypes.object
0.12.14

5 years ago

0.12.13

5 years ago

0.12.12

5 years ago

0.12.11

5 years ago

0.12.10

5 years ago

0.12.9

5 years ago

0.12.8

5 years ago

0.12.7

5 years ago

0.12.6

5 years ago

0.12.5

5 years ago

0.12.4

5 years ago

0.12.3

5 years ago

0.12.2

5 years ago

0.12.1

5 years ago

0.12.0

5 years ago

0.11.0

5 years ago

0.10.1

5 years ago

0.10.0

5 years ago

0.9.4

5 years ago

0.9.3

5 years ago

0.9.2

5 years ago

0.9.1

5 years ago

0.9.0

5 years ago

0.8.0

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.1.0

5 years ago