Skip to content

Appbar

The s-appbar component is a flexible and customizable component designed for building navigation bars in your Vue 3 application. It provides slots for various elements such as a toggle button, title, and additional content, allowing you to create navigation bars tailored to your specific needs.

Registration

ts
import { SAppbar } from "masc-vue";
import { SAppbar } from "masc-vue";

Usage

vue
<template>
	<s-appbar title="Awesome App" wrapClass="bg-primary text-white">
		<template #toggle>
			<s-btn icon="mdi:menu" class="btn-ghost btn-circle text-xl" />
		</template>
		<s-btn class="btn-ghost">Home</s-btn>
		<s-btn class="btn-ghost">Contact</s-btn>
		<s-btn class="btn-ghost">Logout</s-btn>
	</s-appbar>
</template>

<script setup>
import { SAppbar, SBtn } from "masc-vue";
</script>
<template>
	<s-appbar title="Awesome App" wrapClass="bg-primary text-white">
		<template #toggle>
			<s-btn icon="mdi:menu" class="btn-ghost btn-circle text-xl" />
		</template>
		<s-btn class="btn-ghost">Home</s-btn>
		<s-btn class="btn-ghost">Contact</s-btn>
		<s-btn class="btn-ghost">Logout</s-btn>
	</s-appbar>
</template>

<script setup>
import { SAppbar, SBtn } from "masc-vue";
</script>

Props

PropTypeDefaultDescription
titleString""The title displayed in the navigation bar.
wrapClassString""Additional CSS classes for the navigation bar container.
leftBooleanfalseDetermines the alignment of the content. Set to true for left alignment and false for right alignment.

Slots

Slot NameDescription
toggleSlot for the toggle button. Use this slot to provide a button or icon that triggers a sidebar or menu toggle.
titleSlot for the title. Use this slot to customize the title of the navigation bar. If no slot is provided, a default title is displayed.
Default SlotUse the default slot for additional content in the navigation bar, such as navigation links or custom components.

Released under the MIT License.