2.24.0 • Published 3 years ago

mastro-elfo-mui v2.24.0

Weekly downloads
52
License
MIT
Repository
github
Last release
3 years ago

This is a collection of components that extend @material-ui.

Install

yarn add mastro-elfo-mui

or

npm i mastro-elfo-mui

Documentation

The full documentation is available on GitHub Wiki.

Getting started

The start point of this library is then AppContainer component. This is not required, but gives the app some basic configuration.

AppContainer creates wrapper for the theme, the React Suspense component, the Error boundary, the notifier (with notistack), and the router (with react-router-dom).

Example

This example creates an AppContainer with a global theme and that uses HashRouter.

import React from "react";
import { HashRouter } from "react-router-dom";
import primary from "@material-ui/core/colors/blue";
import secondary from "@material-ui/core/colors/pink";

import { AppContainer } from "mastro-elfo-mui";

import HomePage from "./pages/HomePage";

function App() {
  return (
    <AppContainer
      ThemeProps={{
        palette: { primary, secondary },
      }}
      RouterProps={{
        Router: HashRouter,
        routes: [{ path: "/", component: HomePage, exact: true }],
      }}
    />
  );
}

The Page component creates the structure for a page.

A Page has basically an header and a content. They can be any component, but they work well with Header and Content components. header and content are rendered inside a Paper so they reflect the type of palette (light or dark).

A Page also has a print property that is rendered with @media print; on the other hand header and content don't render when printed.

Example

This example creates a basic page with an header and content.

import React from "react";

import { Page, Header, Content } from "mastro-elfo-mui";

function HomePage() {
  return (
    <Page
      header={<Header>Home Page</Header>}
      content={
        <Content>
          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras non mi
          tincidunt, mattis sapien non, facilisis massa.
        </Content>
      }
    />
  );
}

Many components in this library extend their counterpart in material-ui in a specific way.

Other components group some complex structure.

Scripts

The directory 'node_modules/mastro-elfo-mui/dist/scripts/' contains utility scripts.

Example

This command prints a page template.

node node_modules/mastro-elfo-mui/dist/scripts/create-page.js homepage

This command prints a context template.

node node_modules/mastro-elfo-mui/dist/scripts/create-context.js mycontext
2.24.0

3 years ago

2.23.0

3 years ago

2.22.0

3 years ago

2.21.1

3 years ago

2.21.0

3 years ago

2.20.0

3 years ago

2.19.4

3 years ago

2.19.5

3 years ago

2.19.2

3 years ago

2.19.3

3 years ago

2.19.0

3 years ago

2.19.1

3 years ago

2.18.0

3 years ago

2.17.0

3 years ago

2.16.0

3 years ago

2.15.0

3 years ago

2.14.1

4 years ago

2.14.0

4 years ago

2.13.0

4 years ago

2.12.0

4 years ago

2.11.0

4 years ago

2.10.3

4 years ago

2.10.2

4 years ago

2.10.1

4 years ago

2.10.0

4 years ago

2.9.0

4 years ago

2.8.0

4 years ago

2.7.0

4 years ago

2.6.2

4 years ago

2.6.1

4 years ago

2.6.0

4 years ago

2.5.0

4 years ago

2.4.0

4 years ago

2.3.0

4 years ago

2.3.1

4 years ago

2.2.0

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.31.0

4 years ago

1.30.0

4 years ago

1.29.0

4 years ago

1.28.0

4 years ago

1.27.0

4 years ago

1.26.0

4 years ago

1.25.0

4 years ago

1.24.0

4 years ago

1.23.0

4 years ago

1.22.0

4 years ago

1.21.0

4 years ago

1.20.0

4 years ago

1.19.0

4 years ago

1.18.0

4 years ago

1.17.0

4 years ago

1.16.0

4 years ago

1.15.0

4 years ago

1.14.0

4 years ago

1.13.0

4 years ago

1.12.0

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago