@cas-smartdesign/header-layout
v3.1.0
Published
A scrollable layout element with sticky header.
Readme
@cas-smartdesign/header-layout
A layout element with sticky header.
Usage
The layout provides two extension points via slot-elements. It can be used to add header and content with similar slot names.
It is also possible to configure the header in a way to add both normal and small header elements. In this scenario the normal header is shown until the height difference between the two headers is smaller than the scrollTop. The small header is shown otherwise. In order to get this behavior one of the following approaches has to be used:
- Add normal and small header elements in this order to
headerslot. - Add event listener to
header-switchevent and set aminimumHeaderHeightvalue. The event is fired whenshouldShowNormalHeaderflag changes therefore it is possible to change the only header element accordingly.
In addition to the above mentioned approaches the element also dispatches header-layout-scroll CustomEvents with the scrollTop detail, allowing the consumer elements to do optimized layout changes.
