Appbar component

The kit:appbar is an essential component for structuring an application’s header. It provides a dedicated space for displaying elements such as titles, icons, buttons or menus. Thanks to its many customization options, the kit:appbar integrates perfectly into a variety of designs, from minimalist to complex.

appbar.svelte
Lapikit

kit:appbar renders as a <header> by default. It wraps your content in an inner kit-appbar__wrapper div that fills the full width and aligns items in a row. Use classContent to apply a class to that wrapper typically to constrain the max-width of the content while the background spans the full width.

Examples of app bar

Base

The variant prop controls the background and border style.

  • variant: 'filled' | 'outline' | 'text' = 'filled'
appbar.svelte

Density

density adjusts the height and horizontal padding of the appbar.

  • density: 'compact' | 'default' | 'comfortable' = 'default'
appbar.svelte

classContent

classContent applies a CSS class to the inner content wrapper. Use it to constrain the max-width of the content while the appbar background spans the full width.

  • classContent: string | string[] = ''
appbar.svelte

Without preprocess Lapikit

If you aren’t using the Lapikit preprocessor in svelte.config.js, import the component directly:

API Reference

kit:appbar

propstypedescriptiondefault
ref $bindableHTMLElementBindable reference to the rendered DOM element.null
isenum'div''header''nav'HTML element to render.'header'
s-classenum'string''array''object'Sets className on appbar.
s-styleenum'string''array''object'Sets styles on appbar.
variantenum'filled''outline''text'Visual style of the appbar.'filled'
densityenum'none''compact''default''comfortable'Height and horizontal padding.'default'
roundedenum0'xs''sm''md''lg''xl''full'Border radius.0
colorstringForeground color override (--kit-appbar-fg).
backgroundstringBackground color override (--kit-appbar-bg).
classContentstring | string[]Class(es) applied to the inner content wrapper.
childrenSnippetAppbar content.
elevationElevationStateenum'0''1''2''3''4''5'Add shadow effect.
sizeenum'xs''sm''md''lg''xl'Sizing height, font and gap for appbar.'md'

An effective kit:appbar goes well with Dropdown for menus and Avatars for identification.