DocSpace-client/packages/asc-web-components/view-selector/README.md
2021-06-29 15:48:17 +03:00

1.1 KiB

ViewSelector

Actions with a button.

Usage

import { ViewSelector } from "app-components";

View Settings

const viewSettings = [
  {
    value: "row",
    icon: "/static/images/row.react.svg",
  },
  {
    value: "tile",

    icon: "/static/images/tile.react.svg",
    callback: createThumbnails,
  },
];
<ViewSelector
  isDisabled={false}
  onChangeView={(view) => console.log("current view:", view)}
  viewSettings={viewSettings}
  viewAs="row"
/>

Properties

Props Type Required Values Default Description
isDisabled bool - - - Disables the button default functionality
onChangeView func - - - The event triggered when the button is clicked
viewSettings arr - - - Array containing view settings.
viewAs string - - - Current application view