DocSpace-buildtools/packages/components/view-selector
2022-12-07 12:13:30 +05:00
..
index.js Web:Components:View-Selector: Removed id 2022-11-18 19:17:11 +05:00
README.md Web: Moved all clients app to packages directory 2022-07-22 22:01:25 +03:00
styled-view-selector.js Web:Components Fixed the color of the filter icon and sorting on hover 2022-12-07 12:13:30 +05:00
view-selector.stories.js Web: Moved all clients app to packages directory 2022-07-22 22:01:25 +03:00
view-selector.test.js Web: Moved all clients app to packages directory 2022-07-22 22:01:25 +03:00

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"
  isFilter={false}
/>

Properties

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