Primitives

Dialog and Sheet

The drawer dialog is full width on phones; the centred one is for short confirmations.

Import#

Everything comes from the package root. The example above uses:

your-component.tsx
import {
  Button,
  Dialog,
  DialogBody,
  DialogContent,
  DialogDescription,
  DialogFooter,
  DialogHeader,
  DialogTitle,
  DialogTrigger,
  Input,
  Label,
  Switch,
  Sheet,
  SheetContent,
  SheetDescription,
  SheetTitle,
  SheetTrigger,
} from "@waveinno/ui";

Props#

Read from the source of this version, so they match the code exactly.

<DialogBody>

src/components/ui/dialog.tsx

Also takes HTMLAttributes<HTMLDivElement> (passed through).

<DialogContent>

src/components/ui/dialog.tsx
PropTypeDefaultDescription
widthstring—Maximum width, e.g. "max-w-[560px]". The drawer is full width on phones.
sizekeyof typeof SIZES"md"Width preset; `width` wins when both are given.
resizablebooleantrueDrawer only: show the widen / full-width buttons. On by default.
hideCloseboolean—
variant"drawer" | "center""drawer"

Also takes ComponentPropsWithoutRef<typeof DialogPrimitive.Content>.

<DialogDescription>

src/components/ui/dialog.tsx

Also takes ComponentPropsWithoutRef<typeof DialogPrimitive.Description> (passed through).

<DialogFooter>

src/components/ui/dialog.tsx

Also takes HTMLAttributes<HTMLDivElement> (passed through).

<DialogHeader>

src/components/ui/dialog.tsx
PropTypeDefaultDescription
iconReact.ReactNode—A lucide icon (or any node) in a tinted tile beside the title.
eyebrowReact.ReactNode—One short line above the title: the object or step, e.g. "Rate plan" or "Step 2 of 3".

Also takes HTMLAttributes<HTMLDivElement>.

<DialogTitle>

src/components/ui/dialog.tsx

Also takes ComponentPropsWithoutRef<typeof DialogPrimitive.Title> (passed through).

<Button>

src/components/ui/button.tsx
PropTypeDefaultDescription
asChildbooleanfalse
loadingboolean—

Also takes ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants>.

<Input>

src/components/ui/input.tsx
PropTypeDefaultDescription
state"default" | "error" | "warning" | "success""default"
leadingReact.ReactNode—Icon or text inside the box, before the value (a search icon, "৳", "+880").
trailingReact.ReactNode—After the value: a unit, a clear button, a status icon.

Also takes InputHTMLAttributes<HTMLInputElement>.

<Label>

src/components/ui/label.tsx
PropTypeDefaultDescription
requiredboolean—

Also takes ComponentPropsWithoutRef<typeof LabelPrimitive.Root>.

<Switch>

src/components/ui/switch.tsx

Also takes ComponentPropsWithoutRef<typeof SwitchPrimitive.Root> (passed through).

<SheetContent>

src/components/ui/sheet.tsx
PropTypeDefaultDescription
side"right" | "left" | "bottom""right"
widthstring—Width classes for a side sheet. Default "w-full sm:w-drawer".
scrimbooleantrue
hideCloseboolean—

Also takes ComponentPropsWithoutRef<typeof DialogPrimitive.Content>.

Install#

If the project does not have the package yet, add it, then follow the setup for Next.js or Vite once.

$ npm install @waveinno/ui