@blackbox-vision/ra-layout
TypeScript icon, indicating that this package has built-in type declarations

0.0.30 • Public • Published

RA Layout License: MIT

Revamped React Admin UI.

Install

You can install this library via NPM or YARN.

NPM

npm i @blackbox-vision/ra-layout

YARN

yarn add @blackbox-vision/ra-layout

Use case

You're tired of the defacto React Admin UI and want to renew the look and feel.

Usage

The usage is really simple:

  1. Define your menu as a JSON structure like the following:
// menu.ts
import {
  LocalAtm,
  PermContactCalendar,
} from '@material-ui/icons';

export const items = [{
  type: 'group',
  label: 'Architects',
  items: [
    {
      type: 'resource',
      name: 'architects',
      label: 'Information',
      icon: PermContactCalendar,
    },
    {
      type: 'resource',
      name: 'commissions',
      label: 'Commissions',
      icon: LocalAtm,
    },
  ],
}]
  1. Import Layout pass props to it and you're ready:
// App.tsx
import React from 'react';
import { Admin } from 'react-admin';
import jsonServerProvider from 'ra-data-json-server';

import { Layout } from '@blackbox-vision/ra-layout';

import { items } from './menu';

const dataProvider = jsonServerProvider('https://jsonplaceholder.typicode.com');

export const App = () => {
  return (
    <Admin 
      dataProvider={dataProvider}
      layout={props => <Layout {...props} items={items} />}
    >
      <Resource name="users" list={ListGuesser} />
    </Admin>
  );
};

App.displayName = "App";

Props

Layout has the following props:

Properties Types Default Value Description
items Array [] The menu items to render

Issues

Please, open an issue following one of the issues templates. We will do our best to fix them.

Contributing

If you want to contribute to this project see contributing for more information.

License

Distributed under the MIT license. See LICENSE for more information.

Readme

Keywords

none

Package Sidebar

Install

npm i @blackbox-vision/ra-layout

Weekly Downloads

1

Version

0.0.30

License

MIT

Unpacked Size

68.3 kB

Total Files

30

Last publish

Collaborators

  • jonatansalas
  • manutuero