Components
Mobile Tab Bar
The tab bar primitives exposed with mobile naming.
Installation
$ npx veil-ui@latest add mobile-tab-barUsage
import {
MobileTabBar,
MobileTabBarContent,
MobileTabBarList,
} from "@/components/ui/mobile-tab-bar";
<MobileTabBar defaultValue="home">
<MobileTabBarContent value="home">{feed}</MobileTabBarContent>
<MobileTabBarList>{items}</MobileTabBarList>
</MobileTabBar>;Examples
Basic
Home feed
Settings
Home feed
API reference
The package exports mobile-tab-bar along with its composable parts. It forwards standard attributes to its root element; see the examples above for the component-specific props.
Accessibility
- Touch targets are large enough to tap comfortably and keep visible focus rings for keyboard and switch users.
- Gesture interactions (swipe, pull to refresh) have visible button alternatives so they are not the only way to act.
- Sheets, drawers and dialogs follow the underlying accessible primitives for focus trapping and escape handling.
Vue and plain HTML
This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add mobile-tab-bar --framework vue or switch the framework in components.json.
<script setup lang="ts">
import { TabsRoot } from "reka-ui";
import { cn } from "@/lib/utils";
import type { MobileTabBarProps } from "./types";
defineOptions({ inheritAttrs: false });
const props = defineProps<MobileTabBarProps>();
const emit = defineEmits<{ "update:modelValue": [value: string | number] }>();
</script>
<template>
<TabsRoot
v-bind="$attrs"
data-slot="tabs"
:default-value="props.defaultValue"
:model-value="props.modelValue"
:orientation="props.orientation"
:dir="props.dir"
:activation-mode="props.activationMode"
:as-child="props.asChild"
:class="cn('flex flex-col gap-2', props.class)"
@update:model-value="emit('update:modelValue', $event)"
>
<slot />
</TabsRoot>
</template>