@felpsdev/softcomponents v0.3.3
Softcomponents
Project
Project created for ReactJS UI's developing on Softjunk Fivem framework. It uses Mui packages for component developing and Styled Components for styling engine. It gaves all Mui features for good ui experience. Created for Softjunk developing team on propouse to make the ui construction faster and a lot better. You gonna see the documentation right after installation section.
Installation
# npm
npm i @felpsdev/softcomponents --save-dev
# yarn
yarn add @felpsdev/softcomponents
Documentation
You can see the components docs on Mui, and the styling docs on Styled Components, but we developed the theme provider system.
Theme Provider
import { ThemeProvider } from "@felpsdev/softcomponents/styles";
function App() {
return (
<ThemeProvider mode="light">
<LandingPage />
</ThemeProvider>
);
}
Props
Name | Type | Description |
---|---|---|
children | node | The content of the component. |
mode* | "light" | "dark" | Main color theme of the application. |
The theme provider gonna as the name says provide the theme to your components, on Mui components and Styled components.
useTheme
import { useTheme } from "@felpsdev/softcomponents/styles";
function App() {
const [theme, setMode] = useTheme();
const handleChangeMode = () => {
setMode(theme.palette.mode === "dark" ? "light" : "dark");
};
return (
<div>
<span>Current Mode: {theme.palette.mode}</span>
<button onClick={handleChangeMode}>Change mode</button>
</div>
);
}
Return
Index | Type | Description |
---|---|---|
0 | ThemeOptions | Give the theme options |
1 | ("light" | "dark") => void | Function to change the current theme mode |
The theme provider gonna as the name says provide the theme to your components, on Mui components and Styled components.
Others
import { ... } from "@felpsdev/softcomponents/components";
import { ... } from "@felpsdev/softcomponents/hooks";
import { ... } from "@felpsdev/softcomponents/icons";
import { ... } from "@felpsdev/softcomponents/utils";
The package have thoes folders, you can find components, hooks, icons and the utils. Everthing you need is in this folders.
License
- See LICENSE