0.2.22 • Published 3 years ago
danger-ui v0.2.22
danger-ui
Danger UI React Components
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
Property | Type | Values | Description | Default |
---|---|---|---|---|
disabled | boolean | true false | Button can be disabled when true | false |
design | string | regular light round transparent border | Different styles for single component | regular |
radius | number | 0 - 50 | Border radius | 10 |
loading | boolean | true false | Disables button and show loading when true | false |
onClick | function | Triggers function passed | ||
block | boolean | true false | Makes width 100% | false |
Input
Props
Property | Type | Values | Description | Default |
---|---|---|---|---|
disabled | boolean | true false | Button can be disabled when true | false |
design | string | line solid border | Different styles for single component | solid |
radius | number | 0 - 50 | Border radius | 10 |
animated | boolean | true false | Animates label on focus if true | false |
placeholder | string | Sets a placeholder text, if animated becomes a label | ||
value | string``boolean``number | | Sets input value | |||
onChange | function | |||
onFocus | function | |||
onBlur | function | |||
danger | boolean | true``false | Turns de input red | false | ||
dangerText | string | Adds text under input | ||
block | boolean | true``false | Sets the input to full width | false |
Avatar
Props
Property | Type | Values | Description | Default |
---|---|---|---|---|
size | number | Changes dimensions of element | 40 | |
radius | number | 0 - 50 | Border radius | 10 |
src | string | true false | URL to show avatar | false |
defaultAvatar | string | URL from a default image | Gravatar url | |
alt | string | Adds alt to img element | ||
color | string | Can take a color code, or use primary color from css variables | primary | |
~~border~~ | ~~boolean~~ | |||
text | string | If theres no src added it will show 2 characters |
Spinner
Props
Property | Type | Values | Description | Default |
---|---|---|---|---|
size | number | Changes dimensions of element | 20 | |
width | number | Changes dimensions of element | 1 |
Table
Props
Property | Type | Values | Description | Default |
---|---|---|---|---|
columns | array | [] | Maps array and prints it on table header | |
body | jsx | Pass rows for table |
Badge
Props
Property | Type | Values | Description | Default |
---|---|---|---|---|
text | Pass jsx or text |
Select
Props
Property | Type | Values | Description | Default |
---|---|---|---|---|
disabled | boolean | true false | Button can be disabled when true | false |
design | string | line solid border | Different styles for single component | solid |
radius | number | 0 - 50 | Border radius | 10 |
animated | boolean | true false | Animates label on focus if true | false |
placeholder | string | Sets a placeholder text, if animated becomes a label | ||
value | string``boolean``number | | Sets select value | |||
data | array | { option: 'Foo', value: 1} | Takes an array of objects with properties option and value | |
onChange | function | |||
onFocus | function | |||
onBlur | function | |||
danger | boolean | true``false | Turns de input red | false | ||
dangerText | string | Adds text under input | ||
block | boolean | true``false | Sets the input to full width | false |
Alert
Props
Property | Type | Values | Description | Default |
---|---|---|---|---|
children | jsx | Takes in any jsx element | ||
color | string | If not set will use primary color, or use any color format | primary | |
position | string | top-left``top-center``top-right``bottom-left``bottom-center``bottom-right | Changes position of alert on the screen | top-center | ||
visible | boolean | true``false | Displays the alert | false | ||
onClick | function | Execute passed function |
Modal
Props
Property | Type | Values | Description | Default |
---|---|---|---|---|
visible | boolean | true``false | Displays the modal component | false | ||
header | jsx | Displays on top of modal component | ||
footer | jsx | Displays in bottom of modal component | ||
children | jsx | Display on the center of modal component | ||
onClickOut | function | Executes function when click background of modal component |
FormGroup
Props
Property | Type | Values | Description | Default |
---|---|---|---|---|
children | jsx | Takes 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