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
isenum'div''header''nav'HTML element to render.'header'
variantenum'filled''outline''text'Visual style of the appbar.'filled'
densityenum'compact''default''comfortable'Height and horizontal padding.'default'
roundedstringenum0'xs''sm''md''lg''xl'Border radius. Accepts a custom px value.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.

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