1.2.21 • Published 3 years ago

mdui-in-react v1.2.21

Weekly downloads
25
License
ISC
Repository
-
Last release
3 years ago

mdui-in-react

<Input
    onValueChange={newText=>{
        this.setState({inputText:newText})
    }}
    value={inputText}
    header="输入内容"
    icon="link"
    error="这是一个可选的错误信息"
    type="number"
/>

Mdui in react is a react UI Library Based on mdui. It encapsulates the built-in components of mdui (including callback events), and adds some practical extension components.

This project is a derivative project of my website ygktool. Thanks to mdui for its excellent front-end framework!

Quick Start

Install

npm i mdui-in-react or yarn add mdui-in-react

Usage

import '../node_modules/mdui/dist/css/mdui.min.css'

<ComponentName  
    {...props}
/>

MDUI Components

输入框Input

Options

Nametypedefaultdescription
iconstringNo displayThe name of the material design icon to display in front of the input
valuestring--Input content
onValueChangefunc--The callback function after the value of the input box changes. The parameter is the new value
rowsstring--If it exists, it will automatically switch to the textarea label
headerstring输入框Label Text
placeholderstringnullIf there is content (including space), the header will be fixed
otherobject--Other parameters that can be used for input tags, using JSX synatx

列表控制——开关ListControlCheck

Options

Nametypedefaultdescription
iconstringsettingsThe name of the material design icon to display in front of the litem
checkedbooleantrueif check
onCheckedChangefunc--Callback function when value changes, parameter is new value
titlestring开关just as its name implies

滑块RangeInput

Options

Nametypedefaultdescription
valuestring5just as its name implies
onValueChangestringtextCallback function when value changes, the parameter is new value
titlestring调节just as its name implies
otherobject--Other parameters that can be used for inputtype='range' tags(Such as max step..), using JSX synatx.

下拉选择Select

You need to pass in an array similar to the following as the item to be selected.Value is usually used as an identifier

[{    
    name:'通用物体和场景',    
    value:'normal'    
}, {    
    name:'动物',    
    value:'animal'    
}]

Options

Nametypedefaultdescription
optionsobject--Items to be selected
valuenumber--Value corresponding to the selected item
onOptionChangefunc--The callback function after the option is modified. The parameter is the value corresponding to the selected item

Extended components

音频播放器MusicPlayer

Accept a blob link as a prop, support adjusting progress / pause / play / download

options

Nametypedefaultdescription
audioblob--Audio source
titlestring音频播放器A title in the top left corner of card
subtitlestring--A subtitle in the top left corner of card
coverstringhttps://s4.music.126.net/style/web2/img/default/default_album.jpgA img in the left of card
otherobject--Other parameters that can be used for audio tags, using JSX synatx.

颜色选择器ColorInput

The color selector beautifies the inputtype= "color" tag as a block level button with color blocks.

options

Nametypedefaultdescription
valuestring--color value
textstring"选择颜色"标题文字
onColorChangefunc--The callback function after modifying the color. The parameter is the color value
otherobject--Other parameters that can be used for inputtype='color' tags, using JSX synatx.

回顶按钮ToTop

When the screen is more than 148px away from the top, it will automatically appear in the lower left corner. After clicking, the screen will smoothly scroll to the top.

options

Nothing....

对话框菜单选择ListControlMenu

A list item, click to display a dialog box containing the items to be selected. You need to pass in an array similar to 下拉选择

Optinos

Nametypedefaultdescription
itemsarray--Items to be selected
checkednumber--Array subscript corresponding to the selected item
onCheckedChangefunc--The callback function after modifying the option. The parameter is value attribute
titlestring"请选择"标题文字
iconstringsettingsThe name of the material design icon to display in front of the input

Related resources

About

The author is a senior one student

License

1.2.21

3 years ago

1.2.19

3 years ago

1.2.18

3 years ago

1.2.17

4 years ago

1.2.16

4 years ago

1.2.15

4 years ago

1.2.14

4 years ago

1.2.9

4 years ago

1.2.10

4 years ago

1.2.11

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.0

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.4

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago