@front10/flexible-layout

0.0.2 • Public • Published

Example

import React from "react";
import { useLayout, useAriaLabel } from "@front10flexible-layout";

const Text = () => <span>Hello</span>;

const Box = ({ children }) => <div>{children}</div>;

const MyComponent = ({ layout }) => {
  const { dom, ariaLabel } = useLayout(layout, {
    Text,
    Box
  });

  return <Box ariaLabel={ariaLabel}>{dom}</Box>;
};

const MyPage = () => {
  const layout = {
    type: "Box",
    children: [
      {
        type: "Text"
      }
    ]
  };

  return <MyComponent layout={layout} />;
};

Package Sidebar

Install

npm i @front10/flexible-layout

Weekly Downloads

10

Version

0.0.2

License

MIT

Unpacked Size

5.3 kB

Total Files

5

Last publish

Collaborators

  • carburo
  • jlfalcon
  • ycgarrido
  • ycbarrosocu
  • front10devs