GithubHelp home page GithubHelp logo

tamsir / airframe-react Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 0wczar/airframe-react

1.0 1.0 0.0 4.22 MB

Free Open Source High Quality Dashboard based on Bootstrap 4 & React 16: http://dashboards.webkom.co/react/airframe

License: MIT License

JavaScript 98.76% CSS 0.88% HTML 0.36%

airframe-react's Introduction

Airframe React

High Quality Dashboard / Admin / Analytics template that works great on any smartphone, tablet or desktop. Available as Open Source as MIT license.

aiframe-2019-light-primary-ExchangeTrading2x-bfc026c1-0477-45c8-ba55-f6dd43141e4c

Introduction

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 a typical Webpack based React app, React Router also included together with customised Reacstrap. This project has all of it's few dependencies up to date and it will be updated on a regular basis. This project doesn't support SSR. If you need it - use the NextJs based version.

Features

Airframe Dashboard has a huge collection of components that can be used in a great number of combinations and variations. It can be used in all types of custom web applications such as CRMs, CMSs, Admin Panels, Admin Dashboards, Analytics, etc.

  • 10+ Layout Variations - a multitude of possibilities to rearrange the layout, allows to customize the look of your application just as you imagined.
  • Applications - applications ready, allows you to save time and focus on project development.
  • UI Components - we offer you a large number of UI components; fully ready for changes that will customize them for your needs.
  • Responsive Design - fully adapted to your application, exactly well presented on the desktop, a tablet or smartphone.
  • 120+ Unique Pages designed to make use of them directly in your application.
  • 2 Starters so that you can immediately work with the components that are necessary for your application.

Author

Tomasz Owczarczyk:

Installation

Initial Configuration:

You need to have NodeJs (>= 10.0.0) installed on your local machine, before attempting to run a dev environment.

  1. Extract contents of the package to your local machine.
  2. Using the Terminal navigate to the extracted contents.
  3. Run npm install.

Make sure you have a file called .npmrc in the extracted directory. Those files are typically hidden in Unix based systems.

Development

To start the development environment type npm start in the console. This will start a development server with hot reloading enabled.

Production

To create a production build type npm run build:prod. After the process is complete you can copy the output from the /dist/ directory. The output files are minified and ready to be used in a production environment.

Build Customization

You can customize the build to suit your specific needs by adjusting the Webpack configuration files. Those files can be found in the /build directory. For more details checkout the documentation of WebPack.

Project Details

Some points of interest about the project project structure:

  • app/components - custom React components should go here
  • app/styles - styles added here won't be treated as CSS Modules, so any global classes or library styles should go here
  • app/layout - the AppLayout component can be found here which hosts page contents within itself; additional sidebars and navbars should be placed in ./components/ subdir.
  • app/colors.js - exports an object with all of the defined colors by the Dashboard. Useful for styling JS based components - for example charts.
  • app/routes - PageComponents should be defined here, and imported via index.js. More details on that later.

Defining Routes

Route components should be placed in separate directories inside the /routes/ directory. Next you should open /routes/index.js file and attach the component. You can do this in two diffrent ways:

Static Imports

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 (
        <Switch>
            { /* ... */ }
            { /* Define the route for a specific path */ }
            <Route path="/some-page" exact component={SomePage} />
            { /* ... */ }
        </Switch>
    );
}

Dynamic Imports

Dynamically imported pages will only be loaded when they are needed. This will decrease the size of the initial page load and make the App load faster. You can use React.Suspense to achieve this. Example:

// Create a Lazy Loaded Page Component Import
const SomeAsyncPage = React.lazy(() => import('./SomeAsyncPage'));
// ...
export const RoutedContent = () => {
    return (
        <Switch>
            { /* ... */ }
            { /*
                Define the route and wrap the component in a React.Suspense loader.
                The fallback prop might contain a component which will be displayed
                when the page is loading.
            */ }
            <Route path="/some-async-page">
                <React.Suspense fallback={ <PageLoader /> }>
                    <SomeAsyncPage />
                </React.Suspense>
            </Route>
        </Switch>
    );
}

Route specific Navbars and Sidebars

Sometimes you might want to display additional content in the Navbar or the Sidebar. To do this you should define a customized Navbar/Sidebar component and attach it to a particular route. Example:

import { SidebarAlternative } from './../layout/SidebarAlternative';
import { NavbarAlternative } from './../layout/NavbarAlternative';
// ...
export const RoutedNavbars  = () => (
    <Switch>
        { /* Other Navbars: */}
        <Route
            component={ NavbarAlternative }
            path="/some-custom-navbar-route"
        />
        { /* Default Navbar: */}
        <Route
            component={ DefaultNavbar }
        />
    </Switch>  
);

export const RoutedSidebars = () => (
    <Switch>
        { /* Other Sidebars: */}
        <Route
            component={ SidebarAlternative }
            path="/some-custom-sidebar-route"
        />
        { /* Default Sidebar: */}
        <Route
            component={ DefaultSidebar }
        />
    </Switch>
);

Theming

You can set the color scheme for the sidebar and navbar by providing initialStyle and initialColor to the <ThemeProvider> component which should be wrapping the <Layout> component.

Possible initialStyle values:

  • light
  • dark
  • color

Possible initialColor values:

  • primary
  • success
  • info
  • warning
  • danger
  • indigo
  • purple
  • pink
  • yellow

Programatic Theme Changing

You can change the color scheme on runtime by using the ThemeConsumer from the components. Example:

// ...
import { ThemeContext } from './../components';
// ...
const ThemeSwitcher = () => (
    <ThemeConsumer>
        ({ onChangeTheme }) => (
            <React.Fragment>
                <Button onClick={() => onThemeChange({ style: 'light' })}>
                    Switch to Light
                </Button>
                <Button onClick={() => onThemeChange({ style: 'dark' })}>
                    Switch to Dark
                </Button>
            </React.Fragment>
        )
    </ThemeConsumer>
);

Options provided by the ThemeConsumer:

  • style - current theme style
  • color - current theme color
  • onChangeTheme({ style?, color? }) - allows to change the theme

Credits

Used plugins in this dashboard:

airframe-react's People

Contributors

0wczar avatar buncis avatar unski11ed avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.