diff --git a/404.html b/404.html new file mode 100644 index 00000000..3d8dc011 --- /dev/null +++ b/404.html @@ -0,0 +1,38 @@ + + +
+ + + + + + + +
"})]}),o.jsxs("li",{children:["Link ",o.jsx("code",{children:""})]})]})]}),o.jsxs("li",{children:["Block elements",o.jsxs("ul",{children:[o.jsxs("li",{children:["Headers ",o.jsx("code",{children:"h1"})," ",o.jsx("code",{children:"h2"})," ",o.jsx("code",{children:"h3"})," ",o.jsx("code",{children:"h4"})]}),o.jsxs("li",{children:["List",o.jsxs("ul",{children:[o.jsxs("li",{children:["Ordered list ",o.jsx("code",{children:"Button
component propsName | Type | Usage |
---|---|---|
.. | All button element props | |
primary | boolean | To set the primary button |
Chain
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
items | array | Array of string or jsx |
seperator | array | Array of string or jsx (Default: / ) |
Checkbox
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
label | string | |
checked | boolean | |
onChange | function | |
disabled | boolean |
Checkboxes
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
options | array | Array of objects of key & label |
checked | array | Array of selected options keys |
onChange | function | |
disabled | boolean |
Add code snippets like below with PrismJS. Create your custom theme here & import the JS
& CSS
provided at the bottom of the page in the index.html
file.
Note: Only import languages that are actually used in your application as every language imported increases the size of the application.
const snippet = `
+function fun () {
+ return (
+ <div>Hello there!</div>
+ )
+}`
+
+<Code snippet={snippet} lang='jsx' />
Code
Name | Type | Usage |
---|---|---|
.. | All div element props | |
snippet | string | |
lang | string | Check all available languages here |
ColorPicker
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
onValue | function | Better alternative of onChange listener (value) => void . No need to do e.target.value |
Confirm.init
function argumentsName | Type | Usage |
---|---|---|
title | string | |
description | string | |
onConfirm | function | |
onCancel | function | |
confirmText | string | Confirm button text |
cancelText | string | Cancel button text |
type | string | success error warn info |
Confirm.clear
function argumentsName | Type | Usage |
---|---|---|
Empty |
1366px
which can be customized.Sidebar
component propsName | Type | Usage |
---|---|---|
sidebarImg | boolean | Sidebar image |
sidebarItems | array | Sidebar items list, check example above |
onSidebarClick | function | Sidebar item click callback |
sidebarAccess | array | Array of strings of sidebar keys to be visible |
sidebarClassName | string | |
sidebarStyle | object |
Header
component propsName | Type | Usage |
---|---|---|
header | jsx | Header element |
title | string | |
icon | jsx | |
info | string | Extra info after title |
onAdd | function | To show add button in header |
headerSuffix | jsx | |
headerClassName | string | |
headerStyle | object |
Body
component propsName | Type | Usage |
---|---|---|
loading | boolean | |
empty | boolean | |
search | string | Search field value |
onSearch | function | To show search field |
filter | jsx | Filter element |
bodyClassName | string | |
bodyStyle | object |
Footer
component propsName | Type | Usage |
---|---|---|
footer | jsx | Footer element |
onDelete | function | To show delete button |
onCreate | function | To show create button |
onUpdate | function | To show update button |
onCancel | function | To show cancel button |
footerClassName | string | |
footerStyle | object |
Pagination
component propsName | Type | Usage |
---|---|---|
paginationPageSize | number | |
paginationTotalItems | number | |
paginationOffset | number | |
paginationOnChange | function |
Input
component propsName | Type | Usage |
---|---|---|
.. | All input element props | |
onValue | function | Better alternative of onChange listener (value) => void . No need to do e.target.value |
Divider
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
align | string | left right center |
autoCol
in the second row is set to true
which means if rendered in a device with screen width less than or equal to 1080px
i.e. mobile devices, then the elements inside will be rendered in a column.Field
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
label | string |
Fields
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
autoCol | boolean | To render elements inside in a column if screen width is less than colBreakPoint |
colBreakPoint | number | To change default break point used in autoCol (Default: 1080 ) |
autoCol
, do not forget to refresh after opening the developer tools in the browser.File
component propsName | Type | Usage |
---|---|---|
.. | All input element props |
Form
, Fields
& Field
Form
component propsName | Type | Usage |
---|---|---|
.. | All form element props | |
clean | boolean | Turn off auto complete, auto correct, auto capitalize & spell check (Default: false ) |
Input
component propsName | Type | Usage |
---|---|---|
.. | All input element props | |
prefix | string | |
onPrefixClick | function | |
suffix | string | |
onSuffixClick | function | |
onValue | function | Better alternative of onChange listener (value) => void . No need to do e.target.value |
List
component propsName | Type | Usage |
---|---|---|
.. | All ul & ol element props | |
items | array | Array of string & string[] |
type | string | ul | ol (Default: ul ) |
Loader
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
empty | boolean | (Default: false ) |
Menu
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
active | string | |
onClick | function | |
items | array | Array of menu item objects |
item
object keysName | Type | Usage |
---|---|---|
key | string | |
label | string | |
icon | jsx | |
next | array | Array of menu item object under this item |
onClick
function argumentsName | Type | Usage |
---|---|---|
key | string | Clicked tab key |
Message.success(text, duration)
function argumentsName | Type | Usage |
---|---|---|
text | string | Message text |
duration | number | Duration in milliseconds |
Message.info
| Message.warn
| Message.error
Message.clear(message)
function argumentsName | Type | Usage |
---|---|---|
message | symbol | Clear selected message if message argument provided else clear all messages |
Modal
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
visible | boolean | To set the modal visibility |
onClose | function | To close modal on background click |
Select.Multi
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
options | array | Array of option objects containing key & label |
value | array | Array of selected option objects containing key & label |
onChange | function | |
placeholder | string | |
onSearch | function | Shows search box only if search function is passed |
clearable | boolean | |
disabled | boolean |
Select.search
function argumentsName | Type | Usage |
---|---|---|
search | string | Searched text |
options | array | Select input field options |
caseSensitive | boolean | (Default: false ) |
Search
method is provied with Select
component. For calling API or any other functionality, search method need to be implemented.Note
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
type | string | red blue green yellow quote |
Pagination
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
pageSize | number | Number of items on the page |
totalItems | number | Total number of items |
offset | number | Number of items to be skipped |
onChange | function | To update the offset |
disabled | boolean | Useful when pulling the data through API |
onChange
function argumentsName | Type | Usage |
---|---|---|
offset | number | Number of items to be skipped |
Placeholder
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
empty | boolean | (Default: false ) |
Radio
component propsName | Type | Usage |
---|---|---|
options | array | Array of objects of key & label |
checked | string | Selected option key |
onChange | function | |
disabled | boolean |
Range
component propsName | Type | Usage |
---|---|---|
.. | All input element props |
Search
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
value | string | Search field value |
onChange | function | Called when when something is typed |
onClick | function | Called on search field click |
placeholder | string | |
closeOnClick | boolean | |
disabled | boolean |
Select
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
options | array | Array of option objects containing key & label |
value | object | Object of key & label |
onChange | function | |
placeholder | string | |
onSearch | function | Shows search box only if search function is passed |
clearable | boolean | |
disabled | boolean | |
valueHOC | function | Selected value HOC to customize selected option |
optionHOC | function | Option HOC to customize option in list |
Select.Native
component propsName | Type | Usage |
---|---|---|
.. | All input element props | |
options | array | Array of option objects containing key & label |
value | string | Selected option key |
onChange | function | |
disabled | boolean |
Select.search
function argumentsName | Type | Usage |
---|---|---|
search | string | Searched text |
options | array | Select input field options |
caseSensitive | boolean | (Default: false ) |
Search
method is provied with Select
component. For calling API or any other functionality, search method need to be implemented.# | ID | Name | Salary |
---|---|---|---|
1 | 24 | Saige Fuentes | $1000 |
2 | 25 | Bowen Higgins | $2000 |
3 | 31 | Leighton Kramer | $3000 |
4 | 46 | Kylan Gentry | $4000 |
5 | 57 | Amelie Griffith | $2000 |
Table
component propsName | Type | Usage |
---|---|---|
.. | All table element props | |
cols | array | Columns config |
data | array | Table data |
Col
object keysName | Type | Usage |
---|---|---|
name | string | Column name |
key | string | Table data object's key to be rendered |
width | number | Colument width |
align | string | left | center | right |
render | function | Customer renderer |
Col.render
function argumentsName | Type | Usage |
---|---|---|
value | Row data object's key value | |
data | object | Row data object |
index | array | [$row, $col] |
Tab
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
items | array | Array of items |
active | string | Active tab key |
onClick | function | To set active tab |
item
object keysName | Type | Usage |
---|---|---|
key | string | Unique string key |
label | string | Tab label to show |
onClick
function argumentsName | Type | Usage |
---|---|---|
key | string | Clicked tab key |
Textarea
component propsName | Type | Usage |
---|---|---|
.. | All textarea element props | |
autoHeight | boolean | To automatically increase height with content |
Tooltip
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
label | string | Tooltip text |
position | string | top right bottom left (Default: top ) |
delay | number | Tooltip delay in milliseconds (Default: 300 ) |
Do not forget to install some icons pack like Google Icons (Free) , Font Awesome, Stream Line etc to use icons.
Button
component propsName | Type | Usage |
---|---|---|
.. | All button element props | |
primary | boolean | To set the primary button |
Chain
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
items | array | Array of string or jsx |
seperator | array | Array of string or jsx (Default: / ) |
Checkbox
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
label | string | |
checked | boolean | |
onChange | function | |
disabled | boolean |
Checkboxes
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
options | array | Array of objects of key & label |
checked | array | Array of selected options keys |
onChange | function | |
disabled | boolean |
Add code snippets like below with PrismJS. Selected the required languages from here and import the JS as shown below, provided at the bottom of the setup page.
<html>
+ <head>
+ ..
+ </head>
+ <body>
+ ..
+ <script src="/prism.js" data-manual></script>
+ </body>
+</html>
Import code styling from MumpUI
import 'mumpui/dist/styles/code.css'
Usage example
const snippet = `
+function fun () {
+ return (
+ <div>Hello there!</div>
+ )
+}`
+
+<Code snippet={snippet} lang='jsx' />
Note
Code
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
snippet | string | Code to be rendered |
lang | string | Check all available languages here |
MumpUI Color Picker is designed in manner that it can be easily used in a form. It uses native input field for better user experience in mobile devices. It supports HSL, Hex & RGB input and a UI color picker tool.
ColorPicker
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
onValue | function | Better alternative of onChange listener (value) => void . No need to do e.target.value |
Confirm.init
function argumentsName | Type | Usage |
---|---|---|
title | string | |
description | string | |
onConfirm | function | |
onCancel | function | |
confirmText | string | Confirm button text |
cancelText | string | Cancel button text |
type | string | success error warn info |
Confirm.clear
function argumentsName | Usage | |
---|---|---|
Empty |
Close all confirm modals
Data management examples
Customizations
MumpUI dashboard has default max-width of 1366px
which can be customized.
Loader & placeholder
Sidebar
component propsName | Type | Usage |
---|---|---|
sidebar | jsx | Sidebar element |
Header
component propsName | Type | Usage |
---|---|---|
header | jsx | Header element |
title | string | |
icon | jsx | |
info | string | Extra info after title |
onAdd | function | To show add button in header |
headerSuffix | jsx | |
headerClassName | string | |
headerStyle | object |
Body
component propsName | Type | Usage |
---|---|---|
loading | boolean | |
empty | boolean | |
search | string | Search field value |
onSearch | function | To show search field |
filter | jsx | Filter element |
bodyClassName | string | |
bodyStyle | object |
Footer
component propsName | Type | Usage |
---|---|---|
footer | jsx | Footer element |
onDelete | function | To show delete button |
onCreate | function | To show create button |
onUpdate | function | To show update button |
onCancel | function | To show cancel button |
footerClassName | string | |
footerStyle | object |
<MumpUI
+ dashboard={{
+ // Use a common sidebar on all dashboard pages
+ sidebar: {<div> .. </div>}
+ }}
+/>
MumpUI uses default input field as using any 3rd party package always compromises with the user experience in mobile devices.
Input
component propsName | Type | Usage |
---|---|---|
.. | All input element props | |
onValue | function | Better alternative of onChange listener (value) => void . No need to do e.target.value |
Divider
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
align | string | left right center |
autoCol
in the second row is set to true
which means if rendered in a device with screen width less than or equal to 1080px
i.e. mobile devices, then the elements inside will be rendered in a column.
Field
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
label | string |
Fields
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
autoCol | boolean | To render elements inside in a column if screen width is less than colBreakPoint |
colBreakPoint | number | To change default break point used in autoCol (Default: 1080 ) |
To debug autoCol
, do not forget to refresh after opening the developer tools in the browser.
File
component propsName | Usage | |
---|---|---|
.. | All input element props |
Form
, Fields
& Field
Form
component propsName | Type | Usage |
---|---|---|
.. | All form element props | |
clean | boolean | Turn off auto complete, auto correct, auto capitalize & spell check (Default: true ) |
Setting the input field “type” auto-selects the suitable keyboard in mobile devices, improving user experience.
Input
component propsName | Type | Usage |
---|---|---|
.. | All input element props | |
prefix | string | |
onPrefixClick | function | |
suffix | string | |
onSuffixClick | function | |
onValue | function | Better alternative of onChange listener (value) => void . No need to do e.target.value |
maxLength | number | Maximum characters allowed |
parentClassName | string | To add class on wrapper div |
parentStyle | object | To add styling on wrapper div |
List
component propsName | Type | Usage |
---|---|---|
.. | All ul & ol element props | |
items | array | Array of string & string[] |
type | string | ul | ol (Default: ul ) |
Loader
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
empty | boolean | (Default: false ) |
Hello there! +
Markdown
component propsName | Usage | |
---|---|---|
.. | All div element props |
const md = await MD.fetch('/typography.md')
```
+{
+ "name": "markdown"
+}
+```
+
+<!-- meta-break -->
+
+# Title
+
+Hello there!
const { meta, content } = MD.parse(md)
Please note, icon are not packed with MumpUI.
Menu
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
active | string | |
onChange | function | |
items | array | Array of menu item objects |
basePath | string | Application base path which is also set in the router |
item
object keysName | Type | Usage |
---|---|---|
key | string | |
label | string | |
path | string | Navigate to path on click |
icon | jsx | |
next | array | Array of menu item object under this item |
Message.success
function argumentsName | Type | Usage |
---|---|---|
text | string | Message text |
duration | number | Duration in milliseconds |
Message.info
| Message.warn
| Message.error
Message.clear
function argumentsName | Type | Usage |
---|---|---|
message | symbol | Clear selected message if message argument provided else clear all messages |
// Default duration: 3000ms
+// Default max count: 3
+<MumpUI message={{ duration: 2000, max: 1 }} />
Modal
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
title | jsx | Modal title |
buttons | jsx | Modal action buttons |
visible | boolean | To set the modal visibility |
onClose | function | To close modal on background click |
width | string | To change modal width (Default: 600px ) |
noScrollbar | boolean | Hide scrollbar on scrollable modals (Default: false ) |
noCross | boolean | Hide cross icon from modal header (Default: false ) |
Select.Multi
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
options | array | Array of option objects containing key & label |
value | array | Array of selected option objects containing key & label |
onChange | function | |
placeholder | string | |
simpleSearch | function | Show search box in dropdown |
onSearch | function | For advanced search implementation |
clearable | boolean | |
disabled | boolean |
A basic text based Search
method is provied with Select
component. For calling API or any other functionality, search method need to be implemented with onSearch
.
Note
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
type | string | red blue green yellow quote |
Pagination
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
pageSize | number | Number of items on the page |
totalItems | number | Total number of items |
offset | number | Number of items to be skipped |
onChange | function | To update the offset |
disabled | boolean | Useful when pulling the data through API |
onChange
function argumentsName | Type | Usage |
---|---|---|
offset | number | Number of items to be skipped |
Placeholder
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
empty | boolean | (Default: false ) |
Radio
component propsName | Type | Usage |
---|---|---|
options | array | Array of objects of key & label |
checked | string | Selected option key |
onChange | function | |
disabled | boolean |
Range
component propsName | Usage | |
---|---|---|
.. | All input element props |
Search
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
value | string | Search field value |
onChange | function | Called when when something is typed |
onClick | function | Called on search field click |
placeholder | string | |
closeOnClick | boolean | |
disabled | boolean |
Native select component is better for mobile devices as it open a native modal for selection.
Select
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
options | array | Array of option objects containing key & label |
value | object | Object of key & label |
onChange | function | |
placeholder | string | |
simpleSearch | function | Show search box in dropdown |
onSearch | function | For advanced search implementation |
clearable | boolean | |
disabled | boolean | |
valueHOC | function | Selected value HOC to customize selected option |
optionHOC | function | Option HOC to customize option in list |
Select.Native
component propsName | Type | Usage |
---|---|---|
.. | All input element props | |
options | array | Array of option objects containing key & label |
value | string | Selected option key |
onChange | function | |
disabled | boolean |
A basic text based Search
method is provied with Select
component. For calling API or any other functionality, search method need to be implemented with onSearch
.
# | ID | Name | Salary |
---|---|---|---|
1 | 24 | Saige Fuentes | $1000 |
2 | 25 | Bowen Higgins | $2000 |
3 | 31 | Leighton Kramer | $3000 |
4 | 46 | Kylan Gentry | $4000 |
5 | 57 | Amelie Griffith | $2000 |
Table
component propsName | Type | Usage |
---|---|---|
.. | All table element props | |
cols | array | Columns config |
data | array | Table data |
noHeader | boolean | Do not show table header row |
Col
object keysName | Type | Usage |
---|---|---|
name | string | Column name |
key | string | Table data object's key to be rendered |
width | number | Colument width |
align | string | left | center | right |
render | function | Customer renderer |
Col.render
function argumentsName | Type | Usage |
---|---|---|
value | Row data object's key value | |
data | object | Row data object |
index | array | [$row, $col] |
Tab
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
items | array | Array of items |
active | string | Active tab key |
onChange | function | To set active tab |
item
object keysName | Type | Usage |
---|---|---|
key | string | Unique string key |
label | string | Tab label to show |
Textarea
component propsName | Type | Usage |
---|---|---|
.. | All textarea element props | |
autoHeight | boolean | To automatically increase height with content |
maxLength | number | Maximum characters allowed |
parentClassName | string | To add class on wrapper div |
parentStyle | object | To add styling on wrapper div |
Tooltip
component propsName | Type | Usage |
---|---|---|
.. | All div element props | |
label | string | Tooltip text |
position | string | top right bottom left (Default: top ) |
delay | number | Tooltip delay in milliseconds (Default: 300 ) |
// Default 300
+<MumpUI message={{ delay: 500 }} />
# | ID | Name | Salary |
---|---|---|---|
1 | 24 | Saige Fuentes | $1000 |
2 | 25 | Bowen Higgins | $2000 |
3 | 31 | Leighton Kramer | $3000 |
npm i mumpui
MumpUI need to be initialized only once at the top.
import MumpUI from 'mumpui'
+
+function App() {
+ return (<div>
+ {/* Initialize MumpUI */}
+ <MumpUI />
+
+ ..
+
+ <BrowserRouter>
+ <Routes>
+ <Route path="/" />
+ ..
+ </Routes>
+ </BrowserRouter>
+ </div>)
+}
+
+createRoot(document.getElementById('root') as HTMLElement).render(<App />)
import 'mumpui/dist/styles/core.css'
🎉 Voila, good to go! 🚀
MumpUI comes prepacked with typography styling, making it ideal for rendering content, blogs, stories and more. Typography elements are of two types:
<b></b>
<i></i>
<u></u>
<mark></mark>
<del></del>
<code></code>
<a></a>
h1
h2
h3
h4
<ol></ol>
<ul></ul>
<table></table>
<hr />
<blockquote></blockquote>
Risus sed vulputate odio ut enim blandit volutpat. Congue eu consequat ac felis donec et. Arcu felis MumpUI ut tristique et egestas.Senectus et netus et malesuada fames. Amet risus nullam eget felis. Est ullamcorper eget nulla facilisi etiam dignissim. Sed felis eget velit aliquet. Morbi tincidunt ornare massa eget.
Orci eu lobortis elementum nibh. Euismod lacinia at quis risus. Condimentum lacinia quis vel eros donec.
Pulvinar pellentesque habitant morbi tristique. Sapien pellentesque habitant morbi tristique. Mi egetmauris
pharetra et ultrices neque ornare aenean euismod.
Syntax | Description |
---|---|
Header | Title |
Paragraph | Text |
This is an example of blockquote.
`
+ - Link ``
+- Block elements
+ - Headers `h1` `h2` `h3` `h4`
+ - List
+ - Ordered list `