Skip to content
PixiKit

Morphing Header

A sticky header: a full-width transparent bar at the top that becomes a floating, blurred pill once the page scrolls.

pixikit.com/docs/components/morphing-header

Customize

Threshold24px
Morphed
Max width560px
Height60px
Font size15px
Radius14px
Blur12px
Offset10px

Props

14
NameTypeDefaultDescription
thresholdnumber24How far to scroll, in pixels, before the bar becomes a pill.
morphedbooleanNoneHolds the bar as a pill (true) or a full-width bar (false) whatever the scroll; leave unset to follow the scroll.
maxWidthnumber560The pill's largest width in pixels; it never grows past its container.
heightnumber60The bar's height in pixels; the pill is 8px shorter.
fontSizenumber15The text size in pixels.
radiusnumber14The pill's corner radius in pixels.
blurnumber12How much the pill blurs what scrolls under it, in pixels.
offsetnumber10The gap above the pill, in pixels.
scrollTargetRefObject<HTMLElement | null> | stringNoneWhat scrolls: a ref, or a selector matched first among the header's ancestors. Defaults to the window.
brandstring"Lumen"The name at the start of the built-in content; empty hides it.
linksstring[]["Docs", "Pricing", "Blog"]The link labels of the built-in content.
ctastring"Get started"The button label of the built-in content; empty hides it.
classNamestringNone
childrenReactNodeNoneThe bar's content: logo, links, actions. Replaces the built-in brand, links and button.

Related