Primitives

Bottom sheet

Sheet side="bottom": a handle you can drag down to close; a centred card on wider screens.

Import#

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

your-component.tsx
import {
  Button,
  PaymentMethodPicker,
  Sheet,
  SheetContent,
  SheetDescription,
  SheetTitle,
  SheetTrigger,
  toast,
} from "@waveinno/ui";

Props#

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

<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>.

<Button>

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

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

<PaymentMethodPicker>

src/components/ui/payment-method-picker.tsx
PropTypeDefaultDescription
valuestring—
defaultValuestring—
onValueChange(id: string) => void—
methods(PaymentMethodId | PaymentMethod)[]["bkash", "nagad", "card", "cash"]
feesPartial<Record<string, React.ReactNode>>—Beside each method: "No fee", "1.85%", "−৳50".
variant"cards" | "list" | "chips""cards"
disabledboolean—
aria-labelstring"Payment method"
classNamestring—

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