Components
Mobile Dialog
The modal dialog exposed with mobile naming.
Installation
$ npx veil-ui@latest add mobile-dialogUsage
import {
MobileDialog,
MobileDialogContent,
MobileDialogTitle,
MobileDialogTrigger,
} from "@/components/ui/mobile-dialog";
<MobileDialog>
<MobileDialogTrigger asChild>
<Button>Rename project</Button>
</MobileDialogTrigger>
<MobileDialogContent>
<MobileDialogTitle>Rename project</MobileDialogTitle>
</MobileDialogContent>
</MobileDialog>;Examples
Basic
Confirm
API reference
The package exports mobile-dialog 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-dialog --framework vue or switch the framework in components.json.
<script setup lang="ts">
import { Dialog } from "@/components/ui/modal";
const props = defineProps<{
open?: boolean;
defaultOpen?: boolean;
modal?: boolean;
}>();
const emit = defineEmits<{ "update:open": [value: boolean] }>();
</script>
<template>
<Dialog
:open="props.open"
:default-open="props.defaultOpen"
:modal="props.modal"
@update:open="emit('update:open', $event)"
>
<slot />
</Dialog>
</template>