Skip to content

Overlays ​

Ưu tiên Sheet trên Mobile-First / WebView; Dialog cho confirmation. Overlay phức tạp có Preview Mobile và Desktop.

Components ​

  • Dialog — Modal căn giữa. Trên màn hình nhỏ ưu tiên Sheet cho luồng chính.
  • AlertDialog — Dialog xác nhận chặn tương tác.
  • Sheet — Panel trượt từ cạnh — ưu tiên mobile / WebView.
  • Drawer — Bottom sheet (Vaul) với overlay mềm và bo góc sheet.
  • Popover — Bổ trợ desktop — ưu tiên Sheet cho tác vụ mobile chính.
  • DropdownMenu — Menu hành động.
  • Tooltip — Tip hover/focus — không thay Sheet cho tác vụ ưu tiên touch.
  • Command — Primitive command palette cmdk.

Examples ​

Một vài component tiêu biểu. Xem trang component để đủ Props / Behavior.

Dialog ​

tsx
import { Button, Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from "@minap/ui";

export function Example() {
  return (
    <Dialog>
      <DialogTrigger asChild>
        <Button variant="secondary">Open dialog</Button>
      </DialogTrigger>
      <DialogContent className="gap-4">
        <DialogHeader>
          <DialogTitle>Dialog</DialogTitle>
          <DialogDescription>Confirmation surface</DialogDescription>
        </DialogHeader>
        <Button className="w-full">Confirm</Button>
      </DialogContent>
    </Dialog>
  );
}

AlertDialog ​

tsx
import {
  AlertDialog,
  AlertDialogAction,
  AlertDialogCancel,
  AlertDialogContent,
  AlertDialogDescription,
  AlertDialogFooter,
  AlertDialogHeader,
  AlertDialogTitle,
  AlertDialogTrigger,
  Button,
} from "@minap/ui";

export function Example() {
  return (
    <>
      <AlertDialog>
        <AlertDialogTrigger asChild>
          <Button color="destructive" className="w-full">
            Delete…
          </Button>
        </AlertDialogTrigger>
        <AlertDialogContent>
          <AlertDialogHeader>
            <AlertDialogTitle>Confirm</AlertDialogTitle>
            <AlertDialogDescription>Blocking confirm · touch targets ~44px</AlertDialogDescription>
          </AlertDialogHeader>
          <AlertDialogFooter>
            <AlertDialogCancel>Cancel</AlertDialogCancel>
            <AlertDialogAction>Continue</AlertDialogAction>
          </AlertDialogFooter>
        </AlertDialogContent>
      </AlertDialog>
    </>
  );
}

Sheet ​

tsx
import { Button, Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger } from "@minap/ui";

export function Example() {
  return (
    <Sheet>
      <SheetTrigger asChild>
        <Button>Open sheet</Button>
      </SheetTrigger>
      <SheetContent side="bottom" className="gap-4">
        <SheetHeader>
          <SheetTitle>Sheet</SheetTitle>
          <SheetDescription>Mobile-First overlay</SheetDescription>
        </SheetHeader>
        <Button className="w-full">Confirm</Button>
      </SheetContent>
    </Sheet>
  );
}

Drawer ​

tsx
import { Button, Drawer, DrawerContent, DrawerTrigger } from "@minap/ui";

export function Example() {
  return (
    <>
      <Drawer>
        <DrawerTrigger asChild>
          <Button variant="outline" className="w-full">
            Open drawer
          </Button>
        </DrawerTrigger>
        <DrawerContent className="p-4">
          <p className="text-sm">Vaul drawer</p>
        </DrawerContent>
      </Drawer>
    </>
  );
}

MINAP UI — Soft Periwinkle light, Mobile-First