Free Open Source High Quality Dashboard based on Bootstrap 4 & React 16 + Next.js: http://airframe.nextjs.webkom.co
High Quality Dashboard / Admin / Analytics template that works great on any smartphone, tablet or desktop. Available as Open Source as MIT license.
Airframe Dashboard with a minimalist design and innovative Light UI will let you build an amazing and powerful application with great UI. Perfectly designed for large scale applications, with detailed step by step documentation.
This Airframe project is based on NextJs - a popular framework made for React with great Server Side Rendering support. Includes customized Reactstrap for Bootstrap support. Any topic that you won't find here is probably described in NextJs documentation.
Note: If you want to use this project in production, you will need a server supporting NodeJs.
You need to have NodeJs (>= 10.0.0) installed on your local machine, before attempting to run a dev environment.
npm install.
Make sure you have a file called
.npmrcin the extracted directory. Those files are typically hidden in Unix based systems.
To start the development environment type
npm run devin the console. This will start a development server with hot reloading enabled.
You can use a shell script included with the package. If you are using a Unix based system run
./build-dist.shfrom the terminal, and you will have a ready to deploy package in the
/distdirectory.
If you can't use the shell script you need to prepare the package manually: 1. Run
npm run build2. Copy those contents to the target machine *
.next*
static*
package.json*
.npmrc3. Run
npm installon the server where you copied the above contents. 4. You can now start the app by running
npm start
You can add additional build features by adding next plugins and configuring them inside the
next.config.jsfile.
Some points of interest about the project project structure:
components- global React components should go here
styles- styles added here won't be treated as CSS Modules, so any global classes or library styles should go here
features- page specific components should be found here
features/Layout- the
AppLayoutcomponent can be found here which hosts page contents within itself. You can change the Layout component for each page.
core/colors.js- exports an object with all of the defined colors by the Dashboard. Useful for styling JS based components - for example charts.
pages- Page components should be here. NextJs will automatically map the file names to Route URLs.
Route components should be placed in separate directories inside the
/routes/directory. Next you should open
/routes/index.jsfile and attach the component. You can do this in two diffrent ways:
Pages imported statically will be loaded eagerly on PageLoad with all of the other content. There will be no additional loads when navigating to such pages BUT the initial app load time will also be longer. To add a statically imported page it should be done like this:
// Import the default component import SomePage from './SomePage'; // ... export const RoutedContent = () => { return ( { /* ... */ } { /* Define the route for a specific path */ } { /* ... */ } ); }
Routing system is handled by NextJs itself. You can find the documentation here - NextJs Routing
Sometimes you might want to display additional content in the Navbar or the Sidebar. To do this you should define a customized Layout component for a particular Page. Example:
features/layout. Take the
LayoutDefaultcomponent as an example.
pages/example-page.js.
import { CustomLayout } from './../../features/Layout/CustomLayout';
const ExamplePage = () => ( { /* Page Content Here */ } ); ExamplePage.layoutComponent = CustomLayout;
export default ExamplePage; ```
You can set the color scheme for the sidebar and navbar by providing
initialStyleand
initialColorto the component which should be wrapping the component.
Possible
initialStylevalues: * light * dark * color
Possible
initialColorvalues: * primary * success * info * warning * danger * indigo * purple * pink * yellow
You can change the color scheme on runtime by using the
ThemeConsumerfrom the components. Example: ```jsx // ... import { ThemeContext } from './../components'; // ... const ThemeSwitcher = () => ( ({ onChangeTheme }) => ( onThemeChange({ style: 'light' })}> Switch to Light onThemeChange({ style: 'dark' })}> Switch to Dark ) );
Options provided by the `ThemeConsumer`: * **style** - current theme style * **color** - current theme color * **onChangeTheme({ style?, color? })** - allows to change the theme