0.2.1 • Published 2 months ago

@open-pioneer/experimental-layout-sidebar v0.2.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 months ago

@open-pioneer/experimental-layout-sidebar

This package provides a sidebar component. This sidebar consists of a main section (with menu entries) and a content section, which is show, when some of the menu entries are selected.

Integration

Currently the sidebar will be positioned absolute in the provided container. The following properties are provided:

  • It could be set with boolean (defaultExpanded) for default expension.
  • An event expandedChanged is triggered when the main section is expanded/collapsed.
  • sidebarWidthChanged informs about the current width of the sidebar. So the wrapping component can react on this width.
  • the items defined the visible menu entries and their corrensponding content.

See this sample for integration:

<div style={{ position: "relative" }}>
    <Sidebar
        defaultExpanded={isExpanded}
        expandedChanged={(expanded) => setExpanded(expanded)}
        sidebarWidthChanged={(width) => setSidebarWidth()}
        items={items}
    />
</div>

Example for an items array:

const items: SidebarItem[] = [
    {
        id: "sandbox",
        icon: <SomeIcon />,
        label: "Sandbox",
        content: <div>Content goes here...</div>
    }
];

License

Apache-2.0 (see LICENSE file)

0.2.1

2 months ago

0.2.0

4 months ago

0.1.3

11 months ago

0.1.2

12 months ago

0.1.1

12 months ago

0.1.0

12 months ago