AppBar

A top bar or header bar for applications, often used for navigation or branding.

Usage

Basic Usage

Render the AppBar with its sub-components: Header, Body, and Action.

<AppBar variant="solid" position="block">
<AppBar.Header>
<IconButton highContrast variant="transparent">
<Icon type="Home" />
</IconButton>
</AppBar.Header>
<AppBar.Action>
<Button variant="transparent" highContrast>
Blog
</Button>
<IconButton variant="transparent" highContrast>
<Icon type="Github" />
</IconButton>
</AppBar.Action>
</AppBar>

Variants

You can change the visual appearance of the AppBar using the variant prop.

<AppBar variant="transparent" position="block">
<AppBar.Header>
<IconButton highContrast variant="transparent">
<Icon type="Home" />
</IconButton>
</AppBar.Header>
<AppBar.Action>
<Button variant="transparent" highContrast>
Blog
</Button>
<IconButton variant="transparent" highContrast>
<Icon type="Github" />
</IconButton>
</AppBar.Action>
</AppBar>

Body

You can have Body of the AppBar.

<AppBar position="block">
<AppBar.Header>
<IconButton highContrast variant="transparent">
<Icon type="Home" />
</IconButton>
</AppBar.Header>
<AppBar.Body>
<Tab.Root highContrast defaultValue="tab1">
<Tab.List variant="solid" highContrast>
<Tab.Trigger value="tab1" onClick={() => alert('Tab 1 clicked!')}>
Tab 1
</Tab.Trigger>
<Tab.Trigger value="tab2" onClick={() => alert('Tab 2 clicked!')}>
Tab 2
</Tab.Trigger>
</Tab.List>
</Tab.Root>
</AppBar.Body>
<AppBar.Action>
<Button variant="transparent" highContrast>
Blog
</Button>
<IconButton variant="transparent" highContrast>
<Icon type="Github" />
</IconButton>
</AppBar.Action>
</AppBar>

Positions

Set the positioning of the AppBar.

<AppBar position="block">
<AppBar.Header>
<IconButton highContrast variant="transparent">
<Icon type="Home" />
</IconButton>
</AppBar.Header>
<AppBar.Action>
<Button variant="transparent" highContrast>
Blog
</Button>
<IconButton variant="transparent" highContrast>
<Icon type="Github" />
</IconButton>
</AppBar.Action>
</AppBar>

API

Props

AppBar

PropTypeDefaultRequired
classNamestring--
styleCSSProperties--
childrenReactNode--
variant'solid' | 'transparent' | 'translucent''solid'-
position'block' | 'absolute' | 'fixed''fixed'-

Header

PropTypeDefaultRequired
classNamestring--
styleCSSProperties--
childrenReactNode--

Body

PropTypeDefaultRequired
classNamestring--
styleCSSProperties--
childrenReactNode--

Action

PropTypeDefaultRequired
classNamestring--
styleCSSProperties--
childrenReactNode--
mobilebooleanfalse-
Anchor
Previous
Breadcrumb
Next