Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mui-treasury/layout

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mui-treasury/layout

Supercharge your site with instant-layout, 100% compatible with material-ui

  • 4.0.0-alpha.14
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1K
decreased by-13.84%
Maintainers
1
Weekly downloads
 
Created
Source
logo

Material-UI Layout v2 PRs Welcome

A set of components that allows you to build dynamic and responsive layout based on Material-UI

Prerequisites

This project based on React Material-UI, so you have to install @material-ui/core @material-ui/styles.

Installation

// yarn
yarn add @material-ui/core @material-ui/icons @mui-treasury/layout

// npm
npm install @material-ui/core @material-ui/icons @mui-treasury/layout

Demo

see demo here Codesandbox Demo

Usage

import React from 'react';
import {
  Root,
  Header,
  Sidebar,
  SidebarTrigger,
  SidebarTriggerIcon,
  CollapseBtn,
  CollapseIcon,
  Footer,
  Content,
  standardLayoutPreset,
} from '@mui-treasury/layout';
import Box from '@material-ui/core/Box';
import Toolbar from '@material-ui/core/Toolbar';

const App = () => {
  return (
    <Root config={standardLayoutPreset}>
      {({ sidebarStyles, headerStyles }) => (
        <>
          <Header>
            <Toolbar>
              <SidebarTrigger className={headerStyles.leftTrigger}>
                <SidebarTriggerIcon />
              </SidebarTrigger>
              test
            </Toolbar>
          </Header>
          <Sidebar>
            <div className={sidebarStyles.container}>Sidebar</div>
            <CollapseBtn className={sidebarStyles.collapseBtn}>
              <CollapseIcon />
            </CollapseBtn>
          </Sidebar>
          <Content>
            <Box minHeight={1000}>
              <p>Content</p>
            </Box>
          </Content>
          <Footer>Footer</Footer>
        </>
      )}
    </Root>
  );
};

export default App;

Built-in Features

  • Collapsible Nav

    Alt Text

  • Header Magnet

    alt text

  • Auto Collapsed

    alt text

Custom Styles

Mostly, you will custom Header & Nav. This is an example for Header

Presets

  • Standard

    Alt Text

  • Fixed

    Alt Text

  • Content Based

    Alt Text

  • Cozy

    Alt Text

How it works

  • No magic, just React Context API.

  • They are basically material-ui components that are combined to make things easier. AppBar, Drawer

  • use @material-ui/styles to style components

  • use react-hooks

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Keywords

FAQs

Package last updated on 07 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc