Patterns

Empty, error and loading

No bookings yet

Bookings appear here as soon as drivers make them.

This view could not load

The request failed before any rows came back. Nothing has been changed.

Import#

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

your-component.tsx
import { Button, EmptyState, ErrorState, Skeleton } from "@waveinno/ui";

Props#

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

<EmptyState>

src/components/patterns/states.tsx
PropTypeDefaultDescription
iconReact.ElementTypeInbox
titlerequiredstring—
descriptionstring—
actionReact.ReactNode—
classNamestring—

<ErrorState>

src/components/patterns/states.tsx
PropTypeDefaultDescription
titlestring"This view could not load"
descriptionstring"The request failed before any rows came back. Nothing has been changed."
onRetry() => void—
detailstring—

<Button>

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

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

<Skeleton>

src/components/ui/skeleton.tsx

Also takes HTMLAttributes<HTMLDivElement> (passed through).

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