LaraReact Dashboard Template is a Laravel Inertia and React-based web application template designed with inspiration from Sakai PrimeReact for creating modern and interactive dashboard applications. This template provides you with a solid foundation for building powerful web applications with features such as:
- Laravel-based backend
- Inertia.js for seamless SPA development
- React for creating dynamic user interfaces
- PrimeReact UI components for a polished look and feel
- Sakai-react Free React Admin Template CSS
- Vite for faster development experience
LaraReact Dashboard Template is aimed at Laravel developers who want to kickstart their project development with a ready-made template that incorporates these technologies.
To get started with LaraReact Dashboard Template first clone the LaraReact Dashboard Template repository.
Clone Repository:
git clone https://github.com/boadusamuel/laravel-inertia-react
$ npm install
$ npm run dev
$ cp .env.example .env
$ composer install
$ php artisan key:generate
$ php artisan serve
The AppConfig
component is a React component designed to provide a user interface for configuring the layout settings of the project. It utilizes the PrimeReact library for UI components and leverages context provided by the LayoutContext
and PrimeReactContext
to manage and apply configuration changes.
- Usage: Accessing AppConfig Button on the Dashboard
- Configuration Options
- Usage: Applying Selected Theme to App.blade.php
The AppConfig
component provides a convenient way to access and customize the layout settings directly from the dashboard interface. Follow these steps to utilize the AppConfig button:
-
Navigate to the Dashboard:
-
Locate AppConfig Button:
- Look for the configuration button represented by a cog icon typically positioned on the right center of the screen.
-
Click the AppConfig Button:
- Once you've located the AppConfig button, click on it to open the configuration sidebar.
-
Adjust Configuration Options:
- The sidebar will reveal various configuration options:
- Scale: Adjust the font size of the application.
- Menu Type: Choose between "Static" and "Overlay" menu types.
- Input Style: Select between "Outlined" and "Filled" input styles.
- Ripple Effect: Toggle the ripple effect on user interactions.
- Themes: Choose from a variety of themes categorized by design systems (Bootstrap, Material Design, etc.).
- The sidebar will reveal various configuration options:
-
Preview Changes:
- Visualize the changes in real-time as you adjust the configuration options.
-
Apply Theme:
- For theme changes, click on the theme button of your choice to apply the selected theme and color scheme to the entire application.
-
Close AppConfig Sidebar:
- After configuring the settings, you can close the AppConfig sidebar by clicking outside the sidebar or using any provided close button.
The AppConfig
component provides a sidebar with various configuration options that can be adjusted to customize the project's layout and appearance. These options include:
The "Scale" section allows users to adjust the font size of the application. Users can increment or decrement the scale and visualize the changes in real-time.
The "Menu Type" section provides options to select the layout's menu mode. Users can choose between "Static" and "Overlay" menu types, influencing the navigation experience.
The "Input Style" section lets users choose between "Outlined" and "Filled" input styles, influencing the appearance of input fields in the application.
The "Ripple Effect" section includes a toggle switch to enable or disable the ripple effect on user interactions.
The "Themes" section categorizes available themes into different design systems:
- Bootstrap
- Material Design
- Material Design Compact
- Tailwind
- Fluent UI
- PrimeOne Design - 2022
- PrimeOne Design - 2021
For each design system, multiple theme options are provided, each represented by a button with a preview image. Clicking on a theme button applies the selected theme and color scheme to the application.
Feel free to explore and customize these options according to the desired look and feel of the "use client" project.
Once you have chosen a preferred theme, follow these steps to integrate the selected theme into the app.blade.php
file:
-
Choose a Theme:
- Using the AppConfig sidebar, select your preferred theme from the available options.
-
Navigate to app.blade.php:
- Locate the
app.blade.php
file in your project'sresources/views
directory.
- Locate the
-
Paste Link in Head Section:
- Open the
app.blade.php
file and locate the<head>
section. - Paste the
<link>
tag withid="theme-css"
within the<head>
section. It should look something like this with your selected theme:
- Open the
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title inertia>{{ config('app.name', 'LaraReact') }}</title>
<!-- Scripts -->
@routes
@viteReactRefresh
@vite(['resources/js/app.jsx', "resources/js/Pages/{$page['component']}.jsx"])
@inertiaHead
<link id="theme-css" href={{asset('/themes/lara-light-indigo/theme.css')}} rel="stylesheet"></link>
</head>
<body class="font-sans antialiased">
@inertia
</body></html>
- Set the Chosen theme inside the
LayoutProvider
within thelayoutcontext
component
const [layoutConfig, setLayoutConfig] = useState({
ripple: false,
inputStyle: 'outlined',
menuMode: 'static',
colorScheme: 'light',
theme: 'tailwind-light',
scale: 14
});
-
Delete Unwanted Themes:
- In the public directory, navigate to the
images/layout/themes
folder. - Delete the CSS files of the themes you no longer need. This step helps in keeping your project clean and reduces unnecessary file clutter.
- In the public directory, navigate to the
-
Save Changes:
- Save the changes to the
app.blade.php
file.
- Save the changes to the
By following these steps, you have successfully integrated the selected theme into the main layout of your application. Remember to clean up the unwanted themes to maintain a tidy project structure.
NB: This project is still under development please report any bugs to the issue section of this repo