PolyHunter

Dialog

Hover decoration requires a fine pointer and hover support at widths of 768px or more. Phone and touch controls keep tap actions and keyboard focus without rollover effects.

A programmatic modal controlled via open / onOpenChange — no trigger component required. Pass title, tone, body children, and actions / leftActions for the footer.

The shared surface uses surface/default, a 24/30 Funnel Display title, the reusable 32px cross close icon, and extra title space on mobile with spacing-6 desktop padding. These apply to every example below.

Playground

Live preview

Examples

Full-screen review on mobile

Artwork header · Hunter progress

<Dialog open={open} onOpenChange={setOpen}>
  <DialogContent
    variant="artwork"
    artwork={hunterProgressDialogArtwork}
    title="Your Hunter progress"
  >
    XP comes from approved missions and helps you advance through star tiers.
  </DialogContent>
</Dialog>

Title with an icon

Small funding dialog · full-width input

<DialogContent title="Add funds" size="small"><Input className="w-full" /></DialogContent>

Wide review dialog · side-by-side evidence and checks

Danger tone

const [open, setOpen] = useState(false);

<Button variant="destructive" onClick={() => setOpen(true)}>
  Delete guild
</Button>

<Dialog open={open} onOpenChange={setOpen}>
  <DialogContent
    tone="danger"
    title="Delete guild?"
    actions={
      <>
        <DialogClose asChild>
          <Button variant="utility">Cancel</Button>
        </DialogClose>
        <DialogClose asChild>
          <Button variant="destructive">Delete</Button>
        </DialogClose>
      </>
    }
  >
    This permanently removes the guild and all of its progress.
  </DialogContent>
</Dialog>

Custom content

const [open, setOpen] = useState(false);

<Dialog open={open} onOpenChange={setOpen}>
  <DialogContent
    title="Rename hunter"
    actions={
      <DialogClose asChild>
        <Button>Save</Button>
      </DialogClose>
    }
  >
    <div className="flex flex-col gap-2">
      <Label htmlFor="hunter-name">Display name</Label>
      <Input id="hunter-name" placeholder="NovaHunter" />
    </div>
  </DialogContent>
</Dialog>

Left and right actions

const [open, setOpen] = useState(false);

<Dialog open={open} onOpenChange={setOpen}>
  <DialogContent
    title="Guild settings"
    leftActions={
      <DialogClose asChild>
        <Button variant="destructive">Delete guild</Button>
      </DialogClose>
    }
    actions={
      <>
        <DialogClose asChild>
          <Button variant="utility">Cancel</Button>
        </DialogClose>
        <DialogClose asChild>
          <Button>Save</Button>
        </DialogClose>
      </>
    }
  >
    Changes apply to all guild members.
  </DialogContent>
</Dialog>

Fixed-height dialog — footer actions stay at the bottom

Long content — fixed title, close button and actions

Code

import { useState } from "react";
import { Button, Dialog, DialogClose, DialogContent } from "@npolyhunter/ui";

const [open, setOpen] = useState(false);

<Button onClick={() => setOpen(true)}>Open dialog</Button>

<Dialog open={open} onOpenChange={setOpen}>
  <DialogContent
    title="Confirm changes"
    actions={
      <>
        <DialogClose asChild>
          <Button variant="utility">Cancel</Button>
        </DialogClose>
        <DialogClose asChild>
          <Button>Confirm</Button>
        </DialogClose>
      </>
    }
  >
    Your changes will be applied immediately.
  </DialogContent>
</Dialog>

Code

import { useState } from "react";
import { Button, Dialog, DialogClose, DialogContent } from "@npolyhunter/ui";

const [open, setOpen] = useState(false);

<Button onClick={() => setOpen(true)}>Open dialog</Button>

<Dialog open={open} onOpenChange={setOpen}>
  <DialogContent
    title="Confirm changes"
    actions={
      <>
        <DialogClose asChild>
          <Button variant="utility">Cancel</Button>
        </DialogClose>
        <DialogClose asChild>
          <Button>Confirm</Button>
        </DialogClose>
      </>
    }
  >
    Your changes will be applied immediately.
  </DialogContent>
</Dialog>

Used in

Includes use through shared UI components.

AppBack Office