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
BlocksTwo-factor setup

Two-factor setup

Pro

A two-factor setup card where you scan a real, working authenticator QR code, type the 6-digit code into slots that move to the next box on their own, and save your backup codes before it turns on. Every step shares one fixed-size card, so it moves between steps with a short slide and never changes size.

Live block · sample data

When to use

  • Turning on authenticator app two-factor from account or workspace security settings.
  • Enforced two-factor onboarding for admins after sign-in.
  • Re-enrolling a new phone, with fresh backup codes.

When not to use

  • SMS or email one-time codes only: use otp-input in a sign-in form.
  • Passkeys or WebAuthn enrolment, which needs no QR or code step.
  • A full security settings page with sessions and password: use security-settings.

Installation

Pro source and install commands unlock with a Pro plan.

Usage

Use this as the authenticator app step in account or workspace security settings. Pass `secret` and `backupCodes` from your server, along with `issuer` and `account`. Wire `verifyCode(code, signal)` to your TOTP check: return true to continue or false to show the mismatch error. Turn two-factor on in `onEnable(signal)`; if it rejects, an inline error shows. Use `onDone` to go back to settings, `onCancel` to show a Cancel button, and `onStepChange` for analytics. Once you pass `verifyCode`, the simulated authenticator row and the local check go away.

example.tsx
1import { TwoFactorSetup } from "@/components/arc/blocks/two-factor-setup/two-factor-setup";2 3export function SecurityTwoFactor({ setup }: { setup: { secret: string; codes: string[] } }) {4  return (5    <TwoFactorSetup6      issuer="Acme"7      account="dana@acme.com"8      secret={setup.secret}9      backupCodes={setup.codes}10      verifyCode={async (code, signal) => {11        const res = await fetch("/api/2fa/verify", { method: "POST", body: JSON.stringify({ code }), signal });12        return res.ok;13      }}14      onEnable={signal => fetch("/api/2fa/enable", { method: "POST", signal }).then(() => undefined)}15      onDone={() => router.push("/settings/security")}16    />17  );18}
Built fromButtonCheckboxCopy button

API reference

TwoFactorSetup

A three step authenticator app setup card: scan a real TOTP QR code (or copy the setup key), confirm a six digit code, save backup codes, then a final enabled state. With no props it is a working demo that checks real codes for its sample secret.

PropTypeDefaultDescription
issuerstring"Northwind"Product name written into the otpauth URI and shown in the authenticator entry.
accountstring"maya@northwind.io"Account label written into the otpauth URI, usually the email.
secretstring"QK7MR2XD5LVNA3WE"Base32 TOTP secret from your server. The QR code and grouped setup key are built from it.
backupCodesstring[]8 sample codesOne-time recovery codes from your server, shown in a grid and used for Download and Copy.
verifyCode(code: string, signal: AbortSignal) => Promise<boolean>–Checks the six digit code on your server. Resolve true to continue, false to show the mismatch error, reject to show a retry error. Without it the card verifies real TOTP codes for `secret` locally and shows a simulated authenticator entry you can click to fill the code.
onEnable(signal: AbortSignal) => Promise<void> | void–Called from Turn on after the person confirms they saved the codes. Persist two-factor here; reject to show an inline error.
onCancel() => void–Shows a Cancel button on the first step.
onDone() => void–Called from Done on the enabled state. Without it, Done restarts the demo.
onStepChange(step: "scan" | "verify" | "backup" | "enabled") => void–Fires whenever the step changes, for analytics or routing.
addedLabelstring"Added Oct 27, 2026"Date label for the authenticator row on the enabled state.
classNamestring–Class for the card root.

Keyboard interactions

0-9
Types a digit and moves to the next slot. The sixth digit submits.
Backspace
Clears the slot, or the previous slot when this one is empty, and moves back.
LeftorRight, HomeorEnd
Moves between code slots.
Cmd/Ctrl+V
Pastes a full code into all six slots from any slot and submits.
Enter
Submits a complete code.
Tab
Moves through the setup key copy button, slots, checkbox, Download, Copy, Back and the primary action.

Accessibility

  • The card is a labelled section; each step has its own heading, and inactive steps are inert and hidden from assistive tech.
  • The QR code is an SVG with role img and a label naming the issuer and account; the setup key is selectable text with a copy button for people who cannot scan.
  • Code slots are a labelled group with per-digit labels, autocomplete one-time-code on the first slot, and aria-invalid plus a role alert message on a mismatch.
  • Errors use an icon and text, never color alone. A polite live region announces verification, downloads and whether anything was simulated.
  • Moving to the verify step places focus in the first empty slot; the primary button keeps focus across steps.

Motion

  • All steps share one grid cell, so the card never changes size. The outgoing step fades in 100ms; the incoming one fades and slides 12px on a no-bounce spring (0.24s) in the direction of travel.
  • Digits fade in with a 2px rise; the error state changes slot borders and swaps the hint for the message in one crossfade, with no shake.
  • The countdown ring drains in sync with the real 30 second TOTP window using a negative animation delay and only ticks while the verify step is visible on screen.
  • Progress segments fill on a 240ms ease-out; the done check draws itself once.
  • Reduced motion keeps the crossfades and end states, drops the slide, the caret blink and the ring animation.

Responsive behavior

  • Fluid up to 34rem. Below a 460px card width the QR shrinks to 112px beside the copy, apps and setup key go full width, and backup codes move to two columns.
  • Code slots shrink evenly down to a 360px viewport; the 44px checkbox hit area is offset so its square aligns with the text above.
  • Container queries, so it adapts inside dialogs and side panels as well as pages.

Performance

  • The QR is encoded once per otpauth value and drawn as a single merged path plus three eyes.
  • TOTP uses Web Crypto HMAC-SHA1; the clock ticks once per second only on the verify step and pauses off screen.

Notes for AI

Give your coding assistant the Markdown reference instead of screenshots.

  • Use for enabling authenticator app (TOTP) two-factor in account security settings. Pass the server-generated secret and backup codes; never generate secrets in the browser for production.
  • Always pass verifyCode in production so the demo's simulated authenticator entry and local check are removed.
  • Place it in a settings page or a dialog around 480 to 560px wide; it stacks the QR beside a narrower column below 460px.
  • For pairing a device by scanning instead of typing a code, use qr-pairing; for a whole security page with password and sessions, use security-settings.
/components/blocks/two-factor-setup/markdown

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

Related

Security settingsProBlockAn account security page with guided two-factor setup, password change and active sessions.OTP inputBlockA six digit verification flow with paste support and keyboard navigation.Copy buttonComponentCopy a value with immediate confirmation.CheckboxComponentA binary choice with a precise, legible state.
PreviousDomain verifyNextOnboarding survey
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

Two-factor authentication

Step 1 of 3

Scan the QR code

Open your authenticator app and scan this code to add Northwind.

Google Authenticator1Password
Can't scan it? Enter this key
QK7M R2XD 5LVN A3WE

Enter the 6-digit code

Type the code your app shows for Northwind. It changes every 30 seconds.

Simulated app. Click the code above to fill it in.

Save your backup codes

Each code works once. Use one to sign in if you lose your phone.

  1. h4k7-2pmx
  2. 9wqe-7r3d
  3. t2vn-8kfa
  4. m6xc-4jhb
  5. 3rpz-q9we
  6. ky8d-5tmn
  7. a7fs-2xvq
  8. e5nh-6wc8

Two-factor authentication is on

Northwind will ask for a code when you sign in on a new device.

  • Authenticator appAdded Oct 27, 2026
  • Backup codes8 of 8 unused