0.1.12 • Published 2 years ago

frox-ui v0.1.12

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Usage

npm install frox-ui # or yarn add frox-ui
import React from 'react'
import { Theme, GlobalStyle, useGlobalTheme  } from 'frox-ui'

export const YourApp = () => {
  const { globalTheme } = useGlobalTheme();
  return (
    <Theme globalTheme={globalTheme}>
      <GlobalStyle />
      // Your code goes here
    </Theme>
  );
};

Components

Button

PropDescriptionOptional/Required
sizeButton size ◦ Can be large, medium or smallrequired
colorButton color ◦ Can be primary, secondary, success, error, info or warningrequired
iconIf you need an icon on your button, set to determine whether the icon will be to the left or right of the button text ◦ Can be 'left' or 'right'optional
disabledDisable button ◦ Can be true or falseoptional
typeButton type ◦ Can be button, submit or resetoptional
onClickFunction that determines what will happen when the button is pressedoptional
iconUrlString path to the iconoptional
flashOnHoverDetermines whether the flash when the mouse pointer hover the button ◦ Can be true or falserequired

Checkbox

PropDescriptionOptional/Required
idCheckbox unique identifier ◦ Should be stringrequired
labelDefines a label for checkbox ◦ Should be stringoptional
checkedDefines whether the checkbox is checked or not ◦ Can be true or falseoptional
onChangeFunction to control the checkbox ◦ Can take as argument ChangeEvent<HTMLInputElement>optional

Container

PropDescriptionOptional/Required
sizeContainer size ◦ Can be large which max-size is 1530px or small which max-size is 1240pxrequired
childrenChildren of the container ◦ Should be React.ReactNoderequired

CustomSelect

PropDescriptionOptional/Required
optionsSelect options array ◦ Should contain objects with label which is string and value which is stringrequired
handleChangeSelectFunction to manage select. Take selected value as argumentrequired
defaultValueSelect value which displays by default ◦ Can be options array or nulloptional
placeholderSelect placeholder ◦ Should be stringrequired
isDisabledDisable select ◦ Can be true or falseoptional

Input

PropDescriptionOptional/Required
inputSizeInput size ◦ Can be large or smallrequired
labelDefines a label for input ◦ Should be stringrequired
onEnterFunction that determines what will happen when the Enter button is pressedoptional
leftIconSrcString path to the left input iconoptional
rightIconSrcString path to the right input iconoptional
idInput unique identifier ◦ Should be stringrequired

Loader

PropDescriptionOptional/Required
There are no props for this componentPreloader for your application

ModeSwitcher

PropDescriptionOptional/Required
handleChangeFunction to change theme ◦ Should be handleChangeTheme extracted from useGlobalTheme hookrequired

Sidebar

PropDescriptionOptional/Required
sidebarLinksSidebar links array ◦ Should contain objects with label which is string, icon, notification which is string or number and linkTo (the path that the link leads to) which is stringrequired
sidebarButtonsSidebar buttons array ◦ Should contain objects with label which is string and iconrequired
logoSrcPath to logo image ◦ Should be stringrequired
logoAltAlternative text for logo ◦ Should be stringrequired
handleChangeThemeFunction to change theme ◦ Should be handleChangeTheme extracted from useGlobalTheme hookrequired
logoLinkToLink to the page that logo leads to ◦ Should be stringrequired
logoNameName of the logo ◦ Should be stringoptional

Table

PropDescriptionOptional/Required
tableDataTable data arrayrequired
headerItemsTable header items arrayrequired
tableDataCallbackFunction that will be map in table body. Provide inside <Row /> component <Cell /> components with your datarequired