GitHub

DaffSidebarViewportComponent

import { DaffSidebarViewportComponent } from '@daffodil/design/sidebar'

DaffSidebarViewportComponent serves as the container for managing sidebars across an entire application. Because it's a functional component, it supports multiple simultaneously open sidebar and is designed to handle these scenarios gracefully.

However, there is one key contraint: only one sidebar per mode is allowed on each side (e.g., left or right) at any given time.

If this constraint is violated, the component will throw an exception to prevent unintended behavior.

<daff-sidebar-viewport>
   <daff-sidebar></daff-sidebar>
   <div>Site content</div>
</daff-sidebar-viewport>
@Component()
class DaffSidebarViewportComponent implements AfterContentChecked, OnDestroy {
  @Input() navPlacement: DaffNavPlacement = DaffNavPlacementEnum.ABOVE

  @Output() backdropClicked: EventEmitter<void> = new EventEmitter<void>()
}

Inputs

navPlacement
DaffNavPlacement
DefaultDaffNavPlacementEnum.ABOVE
Description

The placement of the nav in relation to the sidebar. Note that this is really only available when there is a side-fixed sidebar.

Outputs

backdropClicked
EventEmitter<void>
Default
Description

Event fired when the backdrop is clicked. This is often used to close the sidebar.