Arc
ComponentsBlocksScreensDocsPricingTry the demo
Get Pro
Saved

Docs

IntroductionInstallationThemingMotionAI and MCPChangelog

Components136

ButtonAction buttonSplit buttonButton groupFloating button groupExpanding button groupCopy buttonAction swapIcon morphConfirm morphTheme switcher

Hold to confirmSwipe actionsReactions

Dropdown menuContext menuUser menu

InputTextareaPassword fieldPassword strengthSearch fieldExpanding searchInline edit

Number fieldMoney inputPhone inputScrub inputTag inputMention inputShortcut recorder

SelectComboboxMulti-selectMorph selectChip group

Radio cardsBilling toggleCheckboxRadio groupSwitchSegmented controlRatingToggle group

SliderElastic sliderRange histogram sliderRuler sliderWindow rangeProLens rangeNewPro

CalendarDate pickerDate range pickerTime pickerColor pickerEmoji pickerPro

Rich text editorSignature padFile dropzoneAvatar uploadPro

TabsBreadcrumbPaginationMega menu morphProTable of contents progressPro

Scroll areaAccordionExpandable cardResizable panelsExpandable text

DialogDrawerBottom sheetPopoverHover cardTooltipShare accessProConfirm popoverPro

AlertToastToast stackAnnouncement barCookie consentUndo toastPro

ProgressSkeletonStepperCountdownUsage meterOnboarding checklist

AvatarAvatar groupBadgePresence stackPro

CardMetric cardEmpty stateMetric tickerPro

Line chartBar chartDonut chartStreamgraphBrush chartWaffle chartSlope chartSparklineGaugeActivity heatmapAnimated counterRidgelineTreemapSplit barPro

SunburstProSankey flowProFunnel chartProRadar chartProRealtime streamProRace bar chartProData gridPro

Sortable data tableTree tableTree viewReorderable listFilter toolbarCode blockJSON viewer

TimelineComment threadChat thread

Image compareCarouselCard stack

Text revealIn-view titleText morphText shimmer

Blocks122

KPI drilldownProMetric explorerProRevenue explorerProMRR waterfallProCohort retentionProUsage forecastProJourney flowProUptime statusProPivot builderProChoropleth explorerProConnected scatterProHorizon chartProAccount healthPro

Budget variancePro

Small multiplesProLine replayPro

AI chatProAI composerProAI answerProModel pickerProModel arenaProPrompt studioProDocument extractionProAgent memoryProAI side panelProAI inline editProResearch runProAI insight cardProCatch upProAI feature launchProAI search barProAI setup wizardProCall insightsProLead scoringPro

Agent runProAgent tasksProAgent approvalsProAgent routinesProAgent orchestratorProMCP serversProKnowledge baseProEval suiteProAgent builderProAgent galleryPro

SidebarPro4Page headerCommand paletteNotification centerSelection toolbarProEmpty statesSearch resultsPro

Login and sign up5, free and Pro variantsOnboarding illustrationProOTP inputMulti-step formProTwo-factor setupProMagic linkPro

Settings pageProSettings commandProSecurity settingsProBilling overviewProUsage billingProCancel flowProOnboarding surveyProSpend alertPro

Team membersProInvite peopleProRoles and permissionsProProfile pagePro

API keysProWebhooksProIntegrationsProImport wizardNewProEnvironment variablesProDomain verifyProWebhook testerPro

Plan comparisonPricing calculatorProUsage pricingProCart drawerProCheckout summaryProLive checkoutProSeat managerProCredit top-upPro

Wallet cardProDelivery trackerProSeat mapPro

Activity feedProSupport widgetProFeature votingPro

File uploadMedia playerPro

Availability pickerProRelease readinessProFeedback boardProSmart schedulerProTask breakdownProGoal trackerPro

Hero sectionHero signupPro

Scroll storyProSpotlight gridProFeature bentoProComparison table

Logo marqueeStudio perspectivesProStats band

Changelog feedFAQ sectionContact sectionTeam showcaseProBlog grid

Site headerSite footerCTA sectionNewsletter signup

Activity terrainProRevenue globeProCustomer galaxyProSemantic zoomProLayout morphProExploded viewPro

Screens14

Metrics dashboardProMarket terminalPro

Kanban boardProProject boardProGantt timelinePro

Week calendarProMonth calendarNewPro

Team directoryPro

Inbox triageProSupport conversationProHelp centerPro

Product listingProProduct detailProInvoice studioPro

Special components107

Share sheetProAction morphProMorph navProDockProLiquid tab barProOrbit menuPro

Glass menuProGlass segmentedProGlass cardProGlass tab barPro

Sheet stackProWallet stackProControl centerProHolo cardProCard to articleProLink unfurlPro

Product galleryProLightbox galleryProPhoto gridProCover flowPro

Voice orbProNow playingProVoice recorderPro

Booking pillProActivity ringsProTime dialProDate reelPro

Keycap keyboardProSlot textSand textProTypewriter terminalPro

Stretch refreshProMorph loaderProSkeleton morphProBlack holeProSlide to confirmNewProCharge sessionPro

Sticker peelProTicket tearProPage curlProOrbit logosProPrize wheelPro

Dot gridProImage trailProGravity wellProInk fluidProCursor trail drawPro

Agent statusProTool callProAgent planProAgent timelineProContext windowProReasoning blockProSource cardsProModel cardProAI workflowProCode suggestionProGhost textProImage generationProDictation buttonProSpeech playerProMeeting summaryProReply draftProAgent handoffProPII redactionProResponse feedbackProLLM cost calculatorProProvider keysProGeneration statsProAI translateProTL;DR toggleProConnector setupProSmart form fillProEnrich columnProTicket routerProAsk your dataProAgent cursorProProvider statusProTraining runProAI commandProStarter promptsProAI mascotProImage revealProAI sparkProPixel mascotProGhost mascotProCube mascotProTone tunerProUpgrade promptProReferral cardProTrial bannerProTeam switcherProLive visitorsProSocial proof toastProInstall snippetPro

Data flowProPayment flowProDNS resolutionProModel trainingProMulti-region failoverProVector searchProBranch graphProAgent loopProMixture of expertsProSpeculative decodingProPrompt cacheProReasoning treePro
What’s new4 new
BlocksCredit top-up

Credit top-up

Pro

A card for buying AI credits. It shows the balance with a 14 day usage chart and how many days are left, three preset packs with bonus badges, a custom amount slider with a live price, auto top-up with a threshold and the saved Visa or Mastercard. When you buy, the new balance rolls in like an odometer.

Live block · sample data

When to use

  • Selling prepaid AI credits or tokens with volume bonuses.
  • A billing settings section where people also manage auto top-up and their card.
  • An out of credits moment where the balance, burn rate and a one click refill belong together.

When not to use

  • Subscription plan changes with seats and billing cycles: use a plan picker or checkout-live.
  • Collecting a new card number: use a card form or a hosted payment element, then pass the saved card here.
  • Read-only usage reporting: use a usage meter or a chart.

Installation

Pro source and install commands unlock with a Pro plan.

Usage

Drop it into a billing page, an out of credits dialog or a top-up drawer. Pass `balance` controlled, plus `usage` (daily credits, oldest first) and `paymentMethods`. Wire `onPurchase(order, signal)` to charge a saved card: resolve when the credits are added, or throw an Error with a short message to show the error state with Try again. `pricing` ({ unitPrice, currency, bonusTiers }) drives every price and bonus. Price orders on the server with the exported `quoteCredits` and the same pricing object. `onAutoTopupChange` and `onPaymentMethodChange` report settings changes. With no props it runs a simulated purchase for a workspace at 840 credits.

example.tsx
1import { CreditTopup } from "@/components/arc/blocks/credit-topup/credit-topup";2 3export function BillingCredits({ workspace }) {4  return (5    <CreditTopup6      balance={workspace.credits}7      usage={workspace.dailyUsage}8      paymentMethods={workspace.cards}9      onPurchase={async (order, signal) => {10        const res = await fetch("/api/credits/purchase", { method: "POST", body: JSON.stringify(order), signal });11        if (!res.ok) throw new Error((await res.json()).message ?? "Payment failed. Try again or change card.");12      }}13      onAutoTopupChange={settings => fetch("/api/credits/auto-topup", { method: "PUT", body: JSON.stringify(settings) })}14    />15  );16}
Built fromButtonSliderSwitch

API reference

2 parts. The first is the root.

CreditTopup

A card for buying AI credits: the balance with a 14 day usage chart and days left, preset packs with bonus badges, a custom amount slider with a live price, auto top-up with a threshold, the saved card, and a checkout that rolls the new balance in. With no props it plays a simulated purchase for a workspace at 840 credits.

PropTypeDefaultDescription
balancenumber–The current balance in credits, controlled. Any change rolls the numerals. Leave it out and the card keeps its own balance and adds each purchase to it.
defaultBalancenumber840The starting balance when `balance` is left out.
usageCreditUsageDay[]Oct 14 to Oct 27, 2026 sampleDaily usage, oldest first: { date: ISO date, credits }. The last day is today. Drives the bar chart, its hover readout, and the days left estimate (average of the full days).
packsnumber[][1000, 5000, 20000]Preset pack sizes in credits, shown as a radio group. Keep it to three for the layout.
pricingCreditPricing$0.01 a credit, +10% from 5,000, +15% from 20,000{ unitPrice, currency, bonusTiers: { min, percent }[] }. Prices, bonus badges, the total and the per 1,000 rate all derive from it.
range{ min: number; max: number; step: number }{ min: 500, max: 30000, step: 500 }The custom amount slider's range in credits. A slider value equal to a pack selects that pack.
defaultCreditsnumberthe second packThe amount selected on mount.
paymentMethodsCreditPaymentMethod[]Visa 4242, Mastercard 5454Saved cards: { id, brand: "visa" | "mastercard", last4, expires: "MM/YYYY" }. Change cycles through them.
thresholdsnumber[][500, 1000, 2500]Choices for the auto top-up threshold. The balance reads as running low below the selected one.
defaultAutoTopup{ enabled: boolean; threshold: number }{ enabled: false, threshold: 1000 }Auto top-up settings on mount.
onAutoTopupChange(settings: { enabled, threshold, credits }) => void–Called when auto top-up is switched or its threshold changes. credits is the selected amount including bonus.
onPaymentMethodChange(id: string) => void–Called when another saved card is chosen.
onPurchase(order: CreditOrder, signal: AbortSignal) => Promise<void>–Charges the order { credits, bonus, total, price, currency, paymentMethodId }. Resolve once the credits are added; reject with an Error and its message shows with a Try again button. Aborted on unmount. Leave it out to simulate a 1.2s charge.
onPurchased(order: CreditOrder, balance: number) => void–Called after a successful purchase with the new balance.
classNamestring–Extra class on the card.

quoteCredits

The pricing helper the card uses: quoteCredits(credits, pricing) returns { credits, bonus, total, price, currency }. Use it on the server to price the same order.

No props.

Keyboard interactions

Tab
Moves through the packs, slider, auto top-up switch, threshold, Change and Buy credits.
ArrowLeftorArrowRight
Moves between packs or thresholds and selects as it goes. Home and End jump to the first and last.
ArrowLeftorArrowRight on the slider
Steps the custom amount by 500 credits. PageUp and PageDown take larger steps.
Space
Switches auto top-up.
EnterorSpace
Buys the selected credits or changes the card.

Accessibility

  • Packs and thresholds are radio groups with roving focus and labels that read the amount, price and bonus, such as "5,000 credits, $50, 10% bonus".
  • Rolling numerals are aria-hidden; a visually hidden copy of each value is read instead, so screen readers never hear partial digits.
  • A polite live region announces the charge, the result ("Added 5,500 credits. Nothing was charged.") and errors. Without onPurchase it says the checkout is simulated.
  • Balance health is an icon plus a label (Running low, Healthy), never color alone. The usage chart is one image with a spoken summary.
  • The Buy button stays focusable while processing (aria-busy) so keyboard focus is not lost.

Motion

  • After a purchase the balance rolls up odometer style over 0.9s: each digit rolls one way to its target and the lower places take one extra lap, so it reads as counting. New leading places open their width on a bounce-free spring.
  • The total and price roll in 0.24s as the slider moves, in tabular numerals so nothing shifts.
  • The pack selection ring and threshold pill glide between options on a 0.24s spring with no bounce. Status, health, days left and the saved card crossfade (100ms out, 160ms in, 2px rise).
  • The card never changes size between idle, processing, done and error.
  • Reduced motion: numbers and highlights jump to their end state; crossfades stay as plain fades.

Responsive behavior

  • Fluid up to 480px. Below about 450px container width the usage chart moves under the balance and stretches full width, and padding drops to 16px.
  • Packs stay three across down to 320px; the bonus badge sits on the price line so amounts never truncate.
  • Container queries, not viewport queries, so it adapts inside dialogs and sidebars.

Performance

  • Each digit is one transformed strip driven by a motion value: no re-renders while numbers roll.
  • No timers or loops while idle; the only timeout clears the done message.
  • Brand marks are inline SVG, about 1 KB.

Notes for AI

Give your coding assistant the Markdown reference instead of screenshots.

  • Use for usage-based AI products that sell prepaid credits: a billing page section, an out of credits dialog body, or a top-up drawer.
  • Keep pricing on the server authoritative: price orders with the exported quoteCredits and the same pricing object, never trust the client total.
  • Pass balance controlled when credits change elsewhere (live usage); the numerals roll on every change, so it doubles as a live balance.
  • Wire onPurchase to a saved payment method charge (for example a Stripe PaymentIntent with off_session) and throw an Error with a short human message on decline.
/components/blocks/credit-topup/markdown

The full library index for assistants is at /llms.txt.

Related

Live checkoutProBlockA subscription checkout whose summary recomputes as you edit, then glides to the centre and unfolds into a receipt.Payment flowProComponentA card tap goes to a processor, then the network, then the bank and back with authorization, then settlement; each hop lights up with a status label and the amount travels as a chip.Usage meterComponentShow what fills an allowance and how close it is to the limit.SliderComponentPick a value or a range on a track that follows your finger.SwitchComponentA tactile toggle for settings that take effect immediately.ButtonComponentA clear, responsive action with quiet secondary states.
PreviousFeature votingNextGoal tracker
Arc · 122 block pagesllms.txt

On this page

  • Preview
  • When to use
  • When not to use
  • Installation
  • Usage
  • API reference
  • Keyboard
  • Accessibility
  • Motion
  • Responsive behavior
  • Performance
  • Notes for AI
  • Related
View as Markdown
Credit balanceRunning low
840001234567890001234567890001234567890credits
About 2 days left at 387 a day
Last 14 days
Add credits$10 per 1,000
Custom amount00123456789,001234567890012345678900123456789 credits
Auto top-upRefills with your selected amount
Refill when below
Visa ending 4242Expires 08/2028
5,500001234567890,001234567890001234567890001234567890 creditsIncludes 500001234567890001234567890001234567890 bonus
$50.00001234567890001234567890.001234567890001234567890
Simulated checkout. Credits never expire.