UIR

InvoiceFolder

A folder with a frosted-glass front and invoice sheets peeking out the top. The sheets bob gently; press it and they lift and fan out while the folder dips and the logo sticker tilts.

Preview

Preview coming soon

Try it live: run the CLI command below in an Expo app, or open the Code tab.

Installation

npx @codewithrabby/ui@latest add invoice-folder

Usage

import { InvoiceFolder } from "@/components/uir/invoice-folder";

const folderW = (width - 40 - 16) / 2; // two per row

<View style={{ flexDirection: "row", flexWrap: "wrap", justifyContent: "space-between", rowGap: 22 }}>
  {clients.map((c, i) => (
    <InvoiceFolder
      key={c.id}
      name={c.name}
      count={c.invoices.length}
      papers={["overdue", "pending", "paid"]}
      sticker={{ label: "F", color: "#a259ff" }}
      // stickerContent={<Image source={c.logo} style={{ width: "100%", height: "100%" }} />}
      width={folderW}
      floatDelay={i * 250}
      onPress={() => router.push(`/clients/${c.id}`)}
    />
  ))}
</View>

Props

PropTypeDefault
name

Label under the folder.

string—
count

Number in the pill next to the name.

number—
papers

Sheets peeking out, back to front. 1–3 look best.

("paid" | "pending" | "overdue")[]—
sticker

Logo sticker: short text on a colour.

{ label, color }—
stickerContent

Any element for the sticker instead, e.g. an <Image>.

ReactNode—
mark

Small mark bottom-left of the front. null hides it.

ReactNode | nullsignature icon
onPress

Called when the folder is tapped.

() => void—
width

Folder width; the height follows.

number160
floatDelay

ms before the idle bob starts. Stagger it in a grid.

number0
paperColors

Override the sheet colours.

Partial<Record<status, string>>—
folderColor

Colour of the folder back.

string"#e4e4e7"