DocSpace-client/packages/components/submenu
2023-11-21 12:43:53 +03:00
..
autoOffset.js Web: Moved all clients app to packages directory 2022-07-22 22:01:25 +03:00
data.js fixed FileInput not working for multiple accept values 2023-11-21 12:43:53 +03:00
index.js Fixed paths 2023-11-10 11:20:02 +04:00
README.md fixed FileInput not working for multiple accept values 2023-11-21 12:43:53 +03:00
styled-submenu.js Web:Delete size props.Return the long line. 2023-10-13 16:47:41 +03:00
submenu.mdx Web: Components: fixed storybook blocks import 2023-05-31 20:00:04 +05:00
submenu.stories.js Web: Components: fixed bug with export default in stories 2023-05-02 16:23:03 +05:00
submenu.test.js Web: Moved all clients app to packages directory 2022-07-22 22:01:25 +03:00

Submenu

Usage

import Submenu from "@docspace/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