Upgrade Prompt

Explains a plan limit and offers what to do next.

New workflows: 5 of 5 workflows used.

Free includes 5 workflows. Team has no limit, and adds paths and version history.

Compare plans

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/gate

Usage

import { Gate } from "./ui/uicontext/components/kit/Gate.ts"
const Message = UiSchema.TaggedEnum({ ClickedUpgrade: {} })export const SeatLimit = (h: Html.H<typeof Message.Type>, used: number, limit: number) =>	Gate(h, {		props: {			feature: "Inviting members",			kind: "limit",			limit: { used, limit, unit: "seats" },			needs: "more seats",			action: { label: "Add seats" },		},		onEmit: { RequestedAction: () => Message.ClickedUpgrade(), RequestedSecondary: () => undefined },	})

Examples

Banner and inline

A banner over a screen when a limit stops work; one line beside a control a role keeps from this person.

Runs: 20,000 of 20,000 tasks used.

New runs are paused until Dec 1. Running work finishes.

Publishing needs an admin.

API reference

Props

Gate props
NameTypeDescription
agentIdstringThis gate's id for agents, unique on the page: "gate-private-teams"
featurerequiredstringWhat is gated, as a noun phrase: "Private teams"
kindrequired"plan" | "addon" | "role" | "region" | "limit" | "waitlist"What kind of gate, for the default sentence
needsstringWhat lifts it, as the sentence's object: "the Business plan", "an admin", "the AI add-on"
limit{ used, limit, unit }For a limit: the count against it
status"locked" | "requested" | "waitlisted" | "invited"Where the person stands: locked, asked an admin already, on the waitlist, or invited
sentencestringReplaces the default sentence
detailstringA second line: what the plan adds, or when the limit resets
actionGateActionThe next step: "Upgrade", "Ask an admin", "Join the waitlist"
secondaryGateActionA second, quieter step: "Compare plans"
layout"card" | "banner" | "inline"A card in place of the feature, a banner over a screen, or one line beside a control

Events

Gate events
EventPayloadDescription
RequestedAction{}The next step was pressed: upgrade, ask an admin, join the waitlist
RequestedSecondary{}The second step was pressed

Agent actions

What agents can do with Gate
ActionDescription
ClickedActionTake the gate's next step (its action: upgrade, ask an admin, join a waitlist)
ClickedSecondaryTake the gate's second step (its secondary)

Accessibility

  • The prompt is a note beside the feature, or a named region over a screen, with its next step as a real button or link.

Source