Header

fun-header is a sticky, slot-driven page header.

Built-in Behavior

  • Scroll-driven mode: switches to scrolled mode once scroll offset exceeds breakpoint + breakpointHysteresis; returns to default below breakpoint - breakpointHysteresis.

  • Title: accepts either a pageTitle string prop or a slot="title" element (e.g. fun-field-label). Both are single-line with end-truncated ellipsis. The title shrinks from h1 to h2 in scrolled mode.

  • Subtitle: collapses with a CSS grid animation when scrolled. Always single-line with ellipsis.

  • Auto slot assignment: direct unslotted fun-button children are automatically assigned slot="primary" (variant primary) or slot="secondary" (all other variants).

  • Action button sizing: fun-button elements in slot="primary", slot="secondary", and inside fun-button-group[slot="primary"] are kept at size="md" via a MutationObserver.

  • Actions layout (left to right): slot="super"slot="tertiary"slot="secondary"slot="primary". Each action slot only renders if content is present.

  • slot="super": optional superuser dropdown — quiet button- IMP: Always wrap this in a condition that checks for super user access.

  • slot="tertiary": optional overflow dropdown — secondary button trigger with an ellipsis icon. Items receive full-width layout inside the dropdown.

  • slot="secondary": inline secondary actions. Button text is hidden on mobile via CSS.

  • slot="primary": inline primary action, rightmost. Supports a single fun-button or a fun-button-group. Button text is hidden on mobile via CSS.

  • Extra row (slot="extra" + slot="extra-right"): collapses with a CSS grid animation when scrolled, unless showExtraOnScroll is true.

  • Breadcrumbs: rendered above the header when breadcrumbsLinks has at least one link and a title is present. Hidden when total crumb count (links + current) is one or fewer.

  • Scroll root: by default fun-header walks its ancestors to find the first scrollable element, then falls back to window. Pass scroll-root (web component) / scrollRoot (React) to pin an explicit scroll container — useful when the scroll container is outside the header’s ancestor chain, e.g. a shell layout or micro-frontend wrapper.

Examples

React code
Web Components code

Index pages

Here is an example of typical index page. Full page demo here

  • Does not have breadcrumb
  • Has description
  • Actions:
    • One primary action : either Button group or regular button
    • Max. 1 secondary action with icon
    • No tertiary actions
    • Optional super user actions
React code
Web components code

Details pages

Here is an example of typical details page. Full page demo here

  • Required breadcrumb starting fron index page (moving away from home as root)
  • Text or FunFieldLabel (fun-field-label) as title
  • Optional badge for
    • Status (fill with color, no icons)
    • Type (Outline neutral with icon/brandlogo)
  • Actions:
    • Max one primary button based on the context.
    • Max. 2 secondary action with icon. Edit is always secondary.
    • Tertiary actions in dropdown triggered by ellipsis (awalwys in the order of below with divider between each section)
      • Data exploration : Open in data explorer, Open in data chat
      • Entity speicific actions : Edit name, Reconnect etc.
      • Duplicate, Copy to workspace(s)
      • Disable & delete (always in text-fun-danger)
    • Optional super actions
React code
Web components code

Edit pages

Here is an example of typical Edit page. Full page demo here

  • Breadcrumb: Starts from index page (not home)> entity > Edit
  • Title: always the name of the enitity either as text or FunFieldLabel (fun-field-label)
  • Actions
    • Primary: Save (with icon: check)
    • Secondary: Cancel (with icon: times)
React code
Web components code

Create page: Default

Here is an example of typical Edit page. Full page demo here

  • Breadcrumb:
    • Rule: Always ends with create
    • Entity > Listing [optiona] > Create (ex: Expors > Destinations > Create, Metrics > Create)
  • Header:
    • Title should always be similar to the CTA that triggers it (ex: Connect data source, Crate export etc)
    • When the create is a step after slecting from list - it should be in a badge - outlined, neutral with brand logo.
  • Actions:
    • Save & Cancel
React code
Web components code

Create page: with wizerd

Here is an example of typical Edit page. Full page demo here

  • Breadcrumb:
    • Rule: Always ends with create
    • Entity > Listing [optiona] > Create (ex: Expors > Destinations > Create, Metrics > Create)
  • Header:
    • Title should always be similar to the CTA that triggers it (ex: Connect data source, Crate export etc)
    • When the create is a step after slecting from list - it should be in a badge - outlined, neutral with brand logo.
  • Actions:
    • Save & Cancel
React code
Web components code

Specifications

Properties

Property Attribute Required Description
breadcrumbsCurrent breadcrumbs-current The current (non-linkable) crumb label for the fallback `fun-breadcrumbs`.
breadcrumbsLinks breadcrumbs-links Breadcrumb links used by the fallback `fun-breadcrumbs`.
breakpoint breakpoint Base scroll breakpoint, in px.
breakpointHysteresis breakpoint-hysteresis Additional px used to avoid rapid mode toggling near the breakpoint.
pageTitle page-title The page title shown in the header.
scrollRoot scroll-root Pin the scroll source explicitly. Accepts an `HTMLElement` or a CSS selector string (e.g. `"#main-scroll-area"`). Use when the scrolling container is outside `fun-header`'s ancestor chain — for example a shell layout wrapping a micro-frontend, or any SPA router outlet. Web component attribute: `scroll-root` React prop: `scrollRoot` When omitted, `fun-header` walks its ancestors and falls back to `window`.
showExtraOnScroll show-extra-on-scroll Keep the extra slot row visible while in scrolled mode. Subtitle still collapses.
subtitle subtitle Optional subtitle shown next to the title.

Slots

Name Description
badge Badge element displayed next to the title.
extra Extra content row displayed below the title and actions.
extra-right Right-aligned content in the extra row, styled as muted small text.
primary Primary action button (or `fun-button-group`) shown inline in the header.
secondary Secondary action buttons shown inline in the header.
super Super-user actions rendered inside a dropdown with a warning-coloured eye icon.
tertiary Overflow actions rendered inside a "more actions" ellipsis dropdown.
title Custom title content rendered instead of the `pageTitle` prop.

Search Gunnel

Powered byAlgolia