0.2.22 • Published 3 years ago

danger-ui v0.2.22

Weekly downloads
9
License
MIT
Repository
github
Last release
3 years ago

danger-ui

Danger UI React Components

NPM JavaScript Style Guide

Example

https://apodacaduron.github.io/danger-ui/

Install

npm install --save danger-ui

Components

Usage

import React from 'react'

import { MyComponent } from 'danger-ui'
import 'danger-ui/dist/index.css'

const Example = () => {
  return <MyComponent />
}

Button

Props

PropertyTypeValuesDescriptionDefault
disabledbooleantrue falseButton can be disabled when truefalse
designstringregular light round transparent borderDifferent styles for single componentregular
radiusnumber0 - 50Border radius10
loadingbooleantrue falseDisables button and show loading when truefalse
onClickfunctionTriggers function passed
blockbooleantrue falseMakes width 100%false

Input

Props

PropertyTypeValuesDescriptionDefault
disabledbooleantrue falseButton can be disabled when truefalse
designstringline solid borderDifferent styles for single componentsolid
radiusnumber0 - 50Border radius10
animatedbooleantrue falseAnimates label on focus if truefalse
placeholderstringSets a placeholder text, if animated becomes a label
valuestring``boolean``number | | Sets input value
onChangefunction
onFocusfunction
onBlurfunction
dangerbooleantrue``false | Turns de input red | false
dangerTextstringAdds text under input
blockbooleantrue``false | Sets the input to full width | false

Avatar

Props

PropertyTypeValuesDescriptionDefault
sizenumberChanges dimensions of element40
radiusnumber0 - 50Border radius10
srcstringtrue falseURL to show avatarfalse
defaultAvatarstringURL from a default imageGravatar url
altstringAdds alt to img element
colorstringCan take a color code, or use primary color from css variablesprimary
~~border~~~~boolean~~Not implemented yet
textstringIf theres no src added it will show 2 characters

Spinner

Props

PropertyTypeValuesDescriptionDefault
sizenumberChanges dimensions of element20
widthnumberChanges dimensions of element1

Table

Props

PropertyTypeValuesDescriptionDefault
columnsarray[]Maps array and prints it on table header
bodyjsxPass rows for table

Badge

Props

PropertyTypeValuesDescriptionDefault
textPass jsx or text

Select

Props

PropertyTypeValuesDescriptionDefault
disabledbooleantrue falseButton can be disabled when truefalse
designstringline solid borderDifferent styles for single componentsolid
radiusnumber0 - 50Border radius10
animatedbooleantrue falseAnimates label on focus if truefalse
placeholderstringSets a placeholder text, if animated becomes a label
valuestring``boolean``number | | Sets select value
dataarray{ option: 'Foo', value: 1}Takes an array of objects with properties option and value
onChangefunction
onFocusfunction
onBlurfunction
dangerbooleantrue``false | Turns de input red | false
dangerTextstringAdds text under input
blockbooleantrue``false | Sets the input to full width | false

Alert

Props

PropertyTypeValuesDescriptionDefault
childrenjsxTakes in any jsx element
colorstringIf not set will use primary color, or use any color formatprimary
positionstringtop-left``top-center``top-right``bottom-left``bottom-center``bottom-right | Changes position of alert on the screen | top-center
visiblebooleantrue``false | Displays the alert | false
onClickfunctionExecute passed function

Modal

Props

PropertyTypeValuesDescriptionDefault
visiblebooleantrue``false | Displays the modal component | false
headerjsxDisplays on top of modal component
footerjsxDisplays in bottom of modal component
childrenjsxDisplay on the center of modal component
onClickOutfunctionExecutes function when click background of modal component

FormGroup

Props

PropertyTypeValuesDescriptionDefault
childrenjsxTakes in any jsx element

License

MIT © apodacaduron

0.2.22

3 years ago

0.2.21

3 years ago

0.2.20

3 years ago

0.2.19

3 years ago

0.2.18

3 years ago

0.2.17

3 years ago

0.2.16

3 years ago

0.2.15

3 years ago

0.2.14

3 years ago

0.2.13

3 years ago

0.2.12

3 years ago

0.2.11

3 years ago

0.2.10

3 years ago

0.2.9

3 years ago

0.2.7

3 years ago

0.2.8

3 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.0

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.3

4 years ago

0.1.0

4 years ago