DocSpace-buildtools/packages/asc-web-components/submenu
2022-05-27 22:01:14 +03:00
..
autoOffset.js Web: Components: Submenu: add onSelect method 2022-03-30 19:17:40 +03:00
data.js completed submenu 2022-02-28 16:08:07 +03:00
index.js Web:Components:Fix store in Submenu component. 2022-05-27 17:27:59 +03:00
loader.js Web:Components:Added LoaderSubmenu. 2022-04-19 10:32:37 +03:00
README.md completed submenu 2022-02-28 16:08:07 +03:00
styled-submenu.js Web: Components: Submenu: Fixed usage of theme property inside styled-submenu.js 2022-05-27 21:57:59 +03:00
submenu.stories.js completed submenu 2022-02-28 16:08:07 +03:00
submenu.stories.mdx completed submenu 2022-02-28 16:08:07 +03:00
submenu.test.js Web: Components: Tests: Fixed test suites 2022-05-27 22:01:14 +03:00

Submenu

Usage

import Submenu from "@appserver/components/submenu";
<Submenu
  data={[
    {
      id: "FileInput",
      name: "File Input",
      content: (
        <FileInput
          accept=".doc, .docx"
          id="file-input-id"
          name="demoFileInputName"
          onInput={function noRefCheck() {}}
          placeholder="Input file"
        />
      ),
    },
    {
      id: "ToggleButton",
      name: "Toggle Button",
      content: (
        <ToggleButton
          className="toggle className"
          id="toggle id"
          label="label text"
          onChange={() => {}}
        />
      ),
    },
  ]}
  startSelect={1}
/>

Data is an array of objects with following fields:

  • id - unique id
  • name - header in submenu
  • content - HTML object that will be rendered under submenu
Example:
{
  id: "FileInput",
  name: "File Input",
  content: (
    <FileInput
      accept=".doc, .docx"
      id="file-input-id"
      name="demoFileInputName"
      onInput={function noRefCheck() {}}
      placeholder="Input file"
    />
  ),
},

Properties

Props Type Required Values Default Description
data array - - List of elements
startSelect obj, number - - 0 Object from data that will be chosen first OR Its index in data array