Scan your whole stack
From OX Research Newsroom
Are you using @zappie/foundations?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.13.0
@zappie/foundations was last scanned on 24 Nov 2026 at version 0.13.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.13.0 LATEST | 24 Nov 2026 | No rules fired |
| 0.12.13 | 24 Nov 2026 | No rules fired |
| 0.12.12 | 23 Nov 2026 | No rules fired |
| 0.12.11 | 21 Nov 2026 | Not shown |
| 0.12.10 | 20 Nov 2026 | Not shown |
Findings for v0.13.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.13.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Unstyled React parts for storefronts. They handle the behaviour, state and accessibility of commerce UI: overlays, item options, quantities, the cart and its totals, fulfilment, addresses, schedules, search, payment methods, one-time codes, images, money and opening hours. You bring the styles.
npm install @zappie/foundations @zappie/sdk react react-dom
React 18.2 or 19 is a peer dependency.
The parts read Zappie data through @zappie/sdk, so wrap them in its ZappieProvider. Each part renders a plain element you can style, or takes a render function:
import type { Branch } from "@zappie/sdk";
import { OpenStatus } from "@zappie/foundations";
export function Hours({ branch }: { branch: Branch }) {
return (
<OpenStatus branch={branch} className="hours">
{(status) => status.label}
</OpenStatus>
);
}
The label reads like "Open until 10pm", "Opens 8am tomorrow" or "Closed", and it updates when the branch opens or closes. Parts expose their state as data-* attributes, such as data-state="open", so you can style each state in CSS.
Want ready-made, styled components instead? Copy them into your project from the kit with npx zappie add <name>.
| Import | For |
|---|---|
@zappie/foundations |
Every part |
@zappie/foundations/next |
Keeping overlays in step with Back and Forward in a Next.js app |
@zappie/foundations/branch-switch |
Choosing a branch in a React Router site without waiting for the server |
@zappie/foundations/checkout |
Checkout behaviour for a bag or a cart page, with no markup |
@zappie/foundations/loyalty |
The rewards sheet's parts, the bag's rewards row and the claim toast |
@zappie/foundations/rich-text |
Sanitising and parsing merchant rich text before you render it |
Foundations is at 0.x. Its API can change in a minor release while it settles. Each change is listed in CHANGELOG.md.
MIT
Keep a bag, branch finder or search dialog off the first load without React.lazy.
React holds a suspended boundary's first reveal for about 300 ms, so a lazy overlay
opens late. deferred() loads the code on demand and renders on the frame it arrives.
It never suspends.
import { deferred, useIntentPreload } from "@zappie/foundations";
const BagSheet = deferred(() => import("./bag-sheet"));
// Or a named export: deferred(() => import("./finder").then((m) => m.Finder))
function Header() {
const [open, setOpen] = useState(false);
const intent = useIntentPreload(BagSheet);
return (
<>
<button {...intent} onClick={() => setOpen(true)}>
Bag
</button>
<BagSheet.Component open={open} onClose={() => setOpen(false)} />
</>
);
}
deferred(load) takes a function that imports a module whose default export
is the component, or that resolves to the component. Create it once at module
scope.Component renders nothing until open is first true and the code is in.
When open turns true it loads the code and renders as soon as it arrives.
After that first open the component stays mounted and receives every prop,
open included, so it can animate out and return focus when it closes.fallback to hold an inline part's place while its code loads, for
example a placeholder label. It shows only while open is true and the code
is not in yet, and it never suspends.failed to show something when the code fails to load, such as a
message with a button that calls retry. It shows only while open is true.
Without it nothing shows, so a shopper who taps and sees nothing never knows
to tap again. A later preload(), such as the one the next tap on the
trigger starts, also retries, and the component renders when it succeeds.preload() starts the load and returns its promise. Calls share one load. A
failed load is forgotten, so the next preload() or the next open tries again.preloadWhenIdle({ timeout? }) loads the code when the browser is idle and
returns a function that cancels it. Use it only for small chunks. It does
nothing on the server.useIntentPreload(target) returns { onPointerEnter, onPointerDown, onFocus }
for the trigger, so the code is usually in by the click.Importing the helper never touches window. On the server Component renders
nothing, and it works under StrictMode.
The first overlay you open on a page paints on the tap. Its backdrop and panel,
with the content, show in the engine's markup straight away, and the overlay's
focus handling, scroll lock and dismissal take over on the next frame. Until
then the panel is hidden from assistive technology and takes no keys, presses or
scrolls, apart from Escape and an outside press, which close it. Style the panel
and [data-zappie-backdrop] as usual: both frames match them.
On a phone or touch screen, a drawer or sheet from Overlay closes when it is
dragged off the screen. It moves the way it is attached: a sheet at the bottom
of the screen drags down, a sheet at a side drags towards that side. It follows
the finger and the backdrop fades. Let go past a quarter of the sheet, or flick
it, and it closes the way the close button does. Otherwise it springs back.
data-no-drag never start a drag.dragToClose={false} on Overlay.Content turns it off. swipeDirection on
Overlay.Root fixes the direction.The sheet has data-drag-to-close (its direction) while it can be dragged and
data-swiping during a drag, so you can show a handle only when it works:
.sheet-handle {
display: none;
}
[data-drag-to-close="down"] .sheet-handle {
display: block;
}
For a sheet you build yourself, useDragToClose does the same:
const dragRef = useDragToClose({ onClose: close, enabled: isOpen });
return isOpen ? (
<div ref={dragRef} role="dialog" aria-modal>
…
</div>
) : null;
useCheckoutFlow from @zappie/foundations/checkout holds a checkout's behaviour and renders nothing. Your template draws the bag or cart page, each field and every word. Call it inside a ZappieProvider, and pass the clients once, not on every render.
import { useCheckoutFlow } from "@zappie/foundations/checkout";
const flow = useCheckoutFlow({ branch, menu, contactFields });
<button
type="button"
data-zappie-checkout=""
data-state={flow.pay.status}
disabled={!flow.pay.enabled}
aria-busy={flow.pay.status === "busy" || undefined}
onClick={async () => show(await flow.pay.activate())}
>
{labels[flow.pay.status]}
</button>;
pay.status is one of, in this order: busy, empty, checking, closed, address, area, time, fix_issues, sign_in, phone, contact, quoting, retry and pay. The first that applies wins.pay.activate() opens payment for pay, signs in for sign_in and asks for the total again for retry. For the other enabled statuses it returns the step to show: { step: "address" }, "area", "time", { step: "issue", issue, target } or { step: "contact", field, target }.target is the selector of the element you marked for that issue or field. Spread issueMarker(issue) on the element that shows each issue, and fieldMarker(key) on each contact control, with phone for the phone. They set data-zappie-issue, data-zappie-issue-line for a line's issue, and data-zappie-field, so document.querySelector(intent.target) finds the element to scroll to and focus. A field taken in a sheet is marked inside the sheet: open it, then find the field.offers lists delivery and pickup where the branch takes them and its menus serve them. initialMode picks the mode a cart that hasn't chosen one starts on. Pickup prices the total straight away. checkoutOffers(branch, menu) lists every mode the branch and its menus take, in venue (dine_in) included. Name it with inVenueLabel(branch) from @zappie/sdk/display. In venue is offered only when you list it in offers, because checkout sessions don't take in-venue orders yet.setDelivery({ address, regionId, note }) changes the address, area and rider note in one step. setAddress, setRegion and setNote change one each, and each builds on the change before it, even in the same event. A new address's own instructions become the rider note. Without them, the note already typed stays.account is the signed-in customer's first name and masked phone, for "Signed in as Ada". It is undefined for a guest./checkout/return, and a cancel to reviewPath, /checkout by default. A sign-in comes back there too, and the details the shopper typed are kept in session storage.checkout event.error is quote_failed, open_failed or sign_in_failed, for your own message.@zappie/foundations/loyalty holds the rewards parts, with no styles. Put
Rewards.Root in your own sheet, such as an Overlay with
presentation="drawer" that drags to close on phones, and pass open so the
perks are read only while it shows. Inside it, Rewards.Points,
Rewards.StoreCredit (only where the branch takes it and holds some),
Rewards.List with one Rewards.Perk per perk and its Rewards.Action,
Rewards.Empty ("No rewards available yet"), Rewards.Error with the API's
message and Rewards.SignInAgain. The action reads Redeem, Remove or "Not
enough points", one at a time, and its accessible name says the perk and its
cost. Give it a 44px target.
useRewardsRow({ signedIn }) says whether the bag shows its rewards row:
signed in, loyalty on and not at the table. usePerkLines() lists the perks
in the totals with Remove: a discount from the quote, and a free item at zero.
On the order confirmation, ClaimToast (or useClaimToast) claims a paid
order's points once and says "You earned N points". Call them inside a
ZappieProvider.
Choosing a branch shows that branch's menu without waiting for the server. A
link to another branch of the store already loaded reads only that branch's
menu in the browser, and the read starts when the shopper reaches for the
button. It has its own entry, @zappie/foundations/branch-switch, so pages
that don't use it never load it. Use it in a React Router root route:
import {
createBranchSwitchLoader,
useReloadingBranch,
} from "@zappie/foundations";
const branchSwitch = createBranchSwitchLoader<ShopData>({
// What your loader returns for ?branch=<that branch>. Recompute every field
// that depends on the branch.
shopAt: (shop, branch, menu) => ({
...shop,
config: { ...shop.config, branch: branch.id },
branch,
menu,
branchChosen: true,
mustChoose: false,
}),
// Paths your loader redirects go to the server.
serverOnly: (url, shop) => Boolean(redirectFor(shop.store, url.pathname)),
});
export const shouldRevalidate: ShouldRevalidateFunction = (args) =>
branchSwitch.shouldRevalidate(args);
export const clientLoader = (args: Route.ClientLoaderArgs) =>
branchSwitch.clientLoader(args);
export default function App() {
const shop = useLoaderData<typeof loader>();
const client = useMemo(() => createZappie(shop.config), [shop.config.branch]);
branchSwitch.remember(shop, client);
return <ZappieProvider client={client}>…</ZappieProvider>;
}
createBranchSwitchLoader({ shopAt, serverOnly?, param? }) returns
remember, shouldRevalidate and clientLoader. Your loader data needs
store, branch and, when the shopper chooses a branch, branchChosen.
Without branchChosen the loaded branch counts as chosen.clientLoader builds the shop with shopAt from the shop the root last
rendered. An unknown branch, a serverOnly URL or a failed read calls
serverLoader(). A cancelled navigation throws.shouldRevalidate reloads the shop only for a link that names another
branch. A link without ?branch= keeps the branch, and so does a link to the
branch already loaded and chosen. Form submissions keep React Router's rule.reloadsShop, branchNamed and loadedBranchOf are the rules behind them,
for your own code.Read the menu on intent, and move the bag before you navigate:
import {
useBranchIntent,
useChooseBranch,
} from "@zappie/foundations/branch-switch";
function BranchCard({ branch }: { branch: Branch }) {
const intent = useBranchIntent(branch);
const navigate = useNavigate();
const choose = useChooseBranch((next) => {
rememberBranch(next.id);
navigate(`/menu?branch=${next.slug}`);
});
return (
<button type="button" {...intent} onClick={() => void choose(branch)}>
Order from {branch.name}
</button>
);
}
useBranchIntent(branch) returns { onPointerEnter, onPointerDown, onFocus }.
Each starts the branch's menu read. The client shares one read per branch,
so the click and the loader reuse it.useChooseBranch(then) starts the menu read, moves a bag with lines to the
branch, and calls then once the move is done. Remember the choice and
navigate in then. Keep the branch ID in your cookie: the server then reads
the store and the menu at once (loadStoreAndMenu in @zappie/sdk/server).Show your own skeleton while the shop reloads for a branch:
const reloading = useReloadingBranch(shop, {
location: useLocation(),
navigation: useNavigation(),
});
return reloading?.pathname === "/menu" ? (
<MenuSkeleton branch={reloading.branch} />
) : (
<Outlet />
);
useReloadingBranch(shop, { location, navigation }, param?) returns
{ branch, pathname } while a navigation reloads the shop for a branch the
store has, and undefined otherwise.
When an add fails validation, ItemForm.Root focuses the first invalid group
with preventScroll, so the page doesn't jump. Pass onInvalid(groups) to
scroll it into view yourself. groups lists the invalid groups in display
order, each with its groupId, its group (undefined for a group the
template renders from its own model), its element and its issues.
<ItemForm.Root
item={item}
onInvalid={(groups) =>
groups[0]?.element?.scrollIntoView({ behavior: "smooth", block: "center" })
}
>
BranchMap accepts SDK Branch[] data, selectedBranchId, onSelect(branch),
browserKey, and optional shopperLocation: { lat, lng }. Use maxZoom to
limit the zoom after fitting, pinImageUrl to show an image in each branch pin,
mapTypeControl to show the map and satellite switch, and pinLabel to show
the branch name above the selected pin ("selected") or every pin ("all").
It also accepts standard div attributes such as className and style.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.