OfferLifetime Pro for $99

Integration Settings

An on/off switch that greys the settings out and keeps them, an API key, a site address validated and normalised to https as you type, a searchable time zone and the sync frequency. A save row slides in only when something changed, and Disconnect sits at the foot behind a typed name.

The decision inside it

A bad key is never stored as if it were fine

Save runs onTest first, and only a key that works reaches onSave; a rejected one says "Rejected (401)" and keeps your draft. Once saved the key is write-only: the card shows a hint, never the key, and revealing a key you are typing is press and hold.

When to use it

Use Integration Settings for one connected service's settings: on/off, an API key that is tested before it is saved and never shown again, a validated site address, time zone, sync frequency and Disconnect. onTest runs before onSave whenever the key changed.

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Layro's Integration Settings for this.
Install it: npx shadcn@latest add @layro/integration-settings
(the @layro registry is set up in components.json, with LAYRO_KEY in .env.local)
Import it from @/components/ui/integration-settings.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @layro registry with your CLI token: see the Namespaced tab.

Usage

components/store-settings.tsx
import { IntegrationSettings, type IntegrationConfig, type KeyCheck } from "@/components/ui/integration-settings";

export function StoreSettings({ config, api }: {
  config: IntegrationConfig;
  api: {
    testKey: (key: string) => Promise<KeyCheck>;
    save: (config: IntegrationConfig, apiKey?: string) => Promise<void>;
    disconnect: () => Promise<void>;
  };
}) {
  return (
    <IntegrationSettings
      service={{ name: "Store" }}
      meta="Connected on March 4, 2026"
      value={config}
      onTest={api.testKey}
      onSave={(next, { apiKey }) => api.save(next, apiKey)}
      onDisconnect={api.disconnect}
    />
  );
}

API reference

“Copy prompt” above puts a full brief on your clipboard — install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

PropTypeNotes
servicerequiredPick<IntegrationService, "name" | "icon" | "logo" | "logoUrl" | "color" | "description">Name and mark. Pass the logo as `logo` (or `icon`), any node.
metaReact.ReactNodeThe line under the name: "Connected on March 4, 2026". Default: the service's description.
countnumberA small number next to the name, e.g. records synced.
valueIntegrationConfigThe saved settings. Controlled.
defaultValueIntegrationConfig—
onChange(config: IntegrationConfig) => voidFires after a save succeeds, with what was saved.
defaultDraftPartial<IntegrationDraft>Start with unsaved edits, e.g. a draft you restored.
keyStatusKeyCheckThe last known health of the saved key.
defaultDraftKeyStatusKeyCheckThe last test of the draft key, e.g. a rejection you restored with the draft.
onTest(apiKey: string) => KeyCheck | Promise<KeyCheck>Tests a key. Runs on Save, before `onSave`, whenever the key changed.
onSave(config: IntegrationConfig, secret: { apiKey?: string }) => void | Promise<void>Saves. `apiKey` is set only when a new key was typed (and passed its test).
onDisconnect() => void | Promise<void>—
timeZonesstring[]Default: a short list of common zones.
sitePlaceholderstringPlaceholder for the site address. Default "yourteam.example.com".
siteHintReact.ReactNodeHelper text under the site address.
nowDate | numberFix the clock, for screenshots and tests.
lookLookLayered sets the settings on a card in a tray, the service above and the save row below. Flat is one card.

Dependencies

npm packages

clsxframer-motionlucide-reacttailwind-merge

Layro foundations, installed alongside it

layro-themebuttoncomboboxinputintegration-pickersegmented-controlswitch

States

All of them are drawn by the component. None is left for you to design.

  • Healthy
  • Unsaved changes
  • Testing
  • Key rejected
  • Saved
  • Disabled
  • Disconnecting

Accessibility

  • Keyboard reachable throughout, in visual order
  • Focus trapped in overlays, Escape closes them
  • Focus returns to whatever opened it
  • Live regions announce what changed, not that something did
  • Honours prefers-reduced-motion

Responsive behavior

  • Sizes to its container, not the viewport
  • Usable from 320px up
  • Pointer-based interaction, so trackpad and touch both work
  • No hover-only affordances

Used in a screenAll screens

Lifetime access

Every component, and everything we ship next.

  • All 232 components, source included
  • Every template, and everything released after you buy
  • shadcn CLI or download — React 18/19, Tailwind v4
  • One payment. No subscription.