Material ripple
Splash screen
RTL support
RTL mode
Theme settings panel
Light style
Material style
Dark style
PAGE LAYOUT
LAYOUT OPTIONS
{{option[1]}}
Fixed navbar
Fixed footer
Reversed
Collapsed sidenav
THEME
NAVBAR BG
{{option}}
SIDENAV BG
{{option}}
FOOTER BG
{{option}}
React Starter
{% if settingsPanel -%}
{% endif %} {% if materialRipple %} {% endif %} {%- if materialRipple and not settingsPanel -%} {% endif %} {% if settingsPanel %} {% endif %}
You need to enable JavaScript to run this app.
{% if splashScreen %}
CompanyName
{% endif %}
import React from 'react' import loadable from '@loadable/component' import pMinDelay from 'p-min-delay' import Loader from './shared/Loader' // Layouts import {{layoutClass(pageLayout)}} from './shared/layouts/{{layoutClass(pageLayout)}}' // Lazy load component const lazy = (cb) => loadable(() => pMinDelay(cb(), 200), { fallback:
}) // --- // Default application layout export const DefaultLayout = {{layoutClass(pageLayout)}} // --- // Document title template export const titleTemplate = '%s - React Starter' // --- // Routes // // Note: By default all routes use { "exact": true }. To change this // behaviour, pass "exact" option explicitly to the route object export const defaultRoute = '/' export const routes = [ { path: '/', component: lazy(() => import('./components/Home')) }, { path: '/page-2', component: lazy(() => import('./components/Page2')) } ]
import React, { Component } from 'react' import Router from './shared/Router' {%- if settingsPanel %} import { connect } from 'react-redux' import { updateThemeSettings } from './store/actions/themeActions' import themeSettings from './vendor/libs/theme-settings' {%- endif %} {% if not settingsPanel -%} import './vendor/styles{% if rtlSupport %}/rtl{% endif %}/bootstrap{% if style == 'material' %}-material{% elif style == 'dark' %}-dark{% endif %}.scss' import './vendor/styles{% if rtlSupport %}/rtl{% endif %}/appwork{% if style == 'material' %}-material{% elif style == 'dark' %}-dark{% endif %}.scss' import './vendor/styles{% if rtlSupport %}/rtl{% endif %}/theme-{{theme}}{% if style == 'material' %}-material{% elif style == 'dark' %}-dark{% endif %}.scss' import './vendor/styles{% if rtlSupport %}/rtl{% endif %}/colors{% if style == 'material' %}-material{% elif style == 'dark' %}-dark{% endif %}.scss' import './vendor/styles{% if rtlSupport %}/rtl{% endif %}/uikit.scss' {%- endif %} import './App.scss' class App extends Component { {%- if settingsPanel %} constructor(props) { super(props) // Update store on theme settings change themeSettings._themeSettings.settings.onSettingsChange = () => this.props.updateThemeSettings() } {%- endif %} render() { return
} } {% if settingsPanel %} export default connect(null, { updateThemeSettings })(App) {% else %} export default App {% endif %}
{%- if settingsPanel -%} import settings from '../../vendor/libs/theme-settings' {% endif -%} const getSettings = () => ({ // Layout navbar color {% if settingsPanel -%} navbarBg: settings.getOption('navbarBg') || '{{navbarBg}}', {%- else -%} navbarBg: '{{navbarBg}}', {%- endif %} // Layout sidenav color {% if settingsPanel -%} sidenavBg: settings.getOption('sidenavBg') || '{{sidenavBg}}', {%- else -%} sidenavBg: '{{sidenavBg}}', {%- endif %} // Layout footer color {% if settingsPanel -%} footerBg: settings.getOption('footerBg') || '{{footerBg}}', {%- else -%} footerBg: '{{footerBg}}', {%- endif %} }) const initialState = getSettings() function reducer(state = initialState, action) { {%- if settingsPanel %} // Update settings if (action.type === 'UPDATE_THEME_SETTINGS') { return getSettings() } {% endif %} return state } export default reducer
$enable-rtl-support: {% if rtlSupport %}true{% else %}false{% endif %}; $enable-light-style: {% if (not settingsPanel and style == 'light') or (settingsPanel and styles.indexOf('light') !== -1) %}true{% else %}false{% endif %}; $enable-material-style: {% if (not settingsPanel and style == 'material') or (settingsPanel and styles.indexOf('material') !== -1) %}true{% else %}false{% endif %}; $enable-dark-style: {% if (not settingsPanel and style == 'dark') or (settingsPanel and styles.indexOf('dark') !== -1) %}true{% else %}false{% endif %}; @mixin feature-ltr($as-child: true) { @if $enable-rtl-support { @if $as-child { html:not([dir=rtl]) & { @content; } } @else { html:not([dir=rtl]) { @content; } } } @else { @content; } } @mixin feature-ltr-style() { @if $enable-rtl-support { &:not([dir=rtl]) { @content; } } @else { @content; } } @mixin feature-rtl($as-child: true) { @if $enable-rtl-support { @if $as-child { [dir=rtl] & { @content; } } @else { [dir=rtl] { @content; } } } } @mixin feature-rtl-style() { @if $enable-rtl-support { &[dir=rtl] { @content; } } }