Navigated to /docs/ui/components/app-bar

AppBar

Top application bar for navigation and product actions.

Preview

A live, theme-aware example rendered with the published component.

Loading preview…

Import

Import the component from its dedicated entry point to keep the dependency and generated bundle explicit.

TSX
tsximport { AppBar } from "@tavojs/ui/app-bar";

Normal Tavo.js applications load component styles through the Tavo.js UI plugin. If the application manages component CSS manually, also import @tavojs/ui/css/app-bar.

When to use

Use it when

Use `AppBar` for page or app headers

Choose something else when

Avoid AppBar when for interactive form state; combine with form, feedback, or data components instead.

Examples

AppBar example

TSX
tsximport { AppBar } from "@tavojs/ui/app-bar";
import { Toolbar } from "@tavojs/ui";

export function AppBarExample1() {
  return (
    <>
      <AppBar align="center" justify="between" gap={{ base: "sm", md: "lg" }}>
        <Toolbar>...</Toolbar>
      </AppBar>
    </>
  );
}

Common props and defaults

PropTypeDefaultDescription
classNamestring

Optional class hook applied to the public root element owned by the component.
asstring | Component<Record<string, unknown>>

Changes the rendered root element or component while preserving Tavo.js UI styling and public props.
position"static" | "sticky" | "fixed" | "relative"

Configures position for this component.
directionResponsiveValue<"row" | "column" | "row-reverse" | "column-reverse">

Configures direction for this component.
alignResponsiveValue<"start" | "center" | "end" | "stretch">

Configures align for this component.
justifyResponsiveValue<"start" | "center" | "end" | "between" | "around">

Configures justify for this component.
gapResponsiveValue<Gap | number | string>

Configures gap for this component.
sxSx

Configures sx for this component.

Complete TypeScript API

Import from @tavojs/ui/app-bar. Published exports: AppBar, AppBarProps.

AppBarProps

PropertyTypeRequiredDescription
childrenChild

No

Inherited children attribute accepted by AppBar.

classNamestring

No

Optional class hook applied to the public root element owned by the component.

sxSx

No

Configures sx for this component.

idstring

No

Inherited id attribute accepted by AppBar.

rolestring

No

Inherited role attribute accepted by AppBar.

styleRecord<string, unknown>

No

Inherited style attribute accepted by AppBar.

titlestring

No

Inherited title attribute accepted by AppBar.

tabIndexnumber

No

Inherited tabIndex attribute accepted by AppBar.

hiddenboolean

No

Inherited hidden attribute accepted by AppBar.

disabledboolean

No

Inherited disabled attribute accepted by AppBar.

onClickTavoEventHandler<MouseEvent>

No

Inherited onClick attribute accepted by AppBar.

onChangeTavoEventHandler<Event>

No

Inherited onChange attribute accepted by AppBar.

onInputTavoEventHandler<Event>

No

Inherited onInput attribute accepted by AppBar.

onKeyDownTavoEventHandler<KeyboardEvent>

No

Inherited onKeyDown attribute accepted by AppBar.

onFocusTavoEventHandler<FocusEvent>

No

Inherited onFocus attribute accepted by AppBar.

onBlurTavoEventHandler<FocusEvent>

No

Inherited onBlur attribute accepted by AppBar.

directionResponsiveValue<FlexDirection>

No

Configures direction for this component.

alignResponsiveValue<FlexAlign>

No

Configures align for this component.

justifyResponsiveValue<FlexJustify>

No

Configures justify for this component.

gapResponsiveValue<string | number>

No

Configures gap for this component.

asPolymorphicAs

No

Changes the rendered root element or component while preserving Tavo.js UI styling and public props.

position"static" | "sticky" | "fixed" | "relative"

No

Configures position for this component.

State ownership and DOM target

ConcernContract
StateNo component state contract is exposed; the application owns the rendered content and surrounding behavior.
DOM targetThe public root follows the as/component prop. Root attributes, className, style, and supported events are forwarded there.

Anatomy and related components

This component exposes one public component root rather than a compound member API.

Limitations

Avoid AppBar when for interactive form state; combine with form, feedback, or data components instead.

Use only the documented props, entry points, and compound members. Internal DOM nesting and CSS class names can change without becoming part of the public component contract.

Accessibility

Defaults to `header`; use `as="nav"` and labels when the bar is navigational.

  • Defaults to `header`; use `as="nav"` and labels when the bar is navigational.

Component status

ContractCurrent value
Maturitystable
Categorylayout
Component import@tavojs/ui/app-bar
Explicit CSS import@tavojs/ui/css/app-bar
PreviewInteractive preview available on this page