Developers

UI primitives & types

Beyond the compound parts, the Kit ships smaller building blocks across a handful of subpaths. Reach for these when you're building a fully bespoke UI and want the same primitives the Kit's own widgets are composed from.

@stridge/kit/ui — 28 primitives

The Kit's internal design system, exposed for hosts that want to compose their own UIs with the same atoms the compound parts use.

import { Button, Card, Dialog, Field, Select } from "@stridge/kit/ui"
PrimitiveRole
AlertInline status block with severity tones.
AmountInputNumeric input with decimal validation and locale-aware grouping.
BadgeSmall status / role label.
ButtonPrimary, secondary, ghost, destructive variants.
CardSurface with elevation variants (default, subdued, framed).
CheckboxAccessible checkbox (Base UI) with first-line label alignment.
CollapsibleDisclosure with chevron + state attribute.
CurrencyGlyphCurrency emblem — country flag with a symbol/code fallback.
DetailsKey/value table row.
DialogModal frame (overlay + content + close affordance).
DisclosureRowCollapsible "More details" row with a rotating chevron.
ExternalLinkLink with target="_blank" + correct rel.
FiatAmountLocalized fiat amount; renders the UAE dirham's SVG sign inline.
FiatSymbolCurrency symbol; the UAE dirham (U+20C3) as an inline SVG.
FieldLabel + control + error stack.
IconButtonIcon-only button with built-in tooltip + hotkey support.
ImageImage with identicon fallback.
InputGroupCluster inputs side-by-side (recipient + paste / amount + max).
LtrAtomForces LTR for numeric content in RTL contexts.
ScrollAreaScrollable region with themed thin scrollbar.
SelectSearchable / unsearchable select with virtualised list.
SelectableTileCard-shaped radio (asset row, method tile, pill chip).
SkeletonShimmer placeholder for loading states.
StepsNumbered step list.
TextTyped text scale (text-sm, text-base, …).
TokenLogoToken / chain logo with convention-driven CDN fallback.
TooltipPositioned tooltip primitive.
WalletRowRow layout for wallet display (logo + label + chevron).

Each primitive carries its own data-stridge-slot namespace — see Data attributes & slots for the targeting catalogue. Each also exports its TypeScript prop types from the same subpath.

Note

The primitives are stable but considered lower-priority than the compound parts. Their primary purpose is internal — the Kit's own widgets compose against them — so the prop surface may evolve faster than the compound API. Pin your @stridge/kit version when leaning heavily on @stridge/kit/ui.

@stridge/kit/icons — custom SVG set

The Kit's own iconography, hand-drawn in a consistent 24×24 / 1.6-stroke vocabulary.

import {
  AlertIcon, ArrowDownIcon, ArrowRightIcon, ArrowRightLeftIcon,
  CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon,
  CircleArrowUpIcon, CircleHelpIcon, ClockIcon, CopyIcon,
  ExternalLinkIcon, InfoIcon, LoaderIcon, LogoIcon,
  MailIcon, PackageIcon, QrCodeIcon, WalletIcon, XIcon,
} from "@stridge/kit/icons"

The Kit deliberately does not depend on lucide-react or other icon libraries; every icon is a small React component shipping its own SVG.

A /exchanges sub-export carries vendor brand marks (Kraken, Coinbase, …) used in the "Send from CEX" hint copy. These are intentionally not themable — vendor brand colours are non-negotiable.

@stridge/kit/wallet — wagmi helpers

Small surface for wallet-aware UI.

import { useWalletState, type ConnectWalletConfig } from "@stridge/kit/wallet"

const { address, chainId } = useWalletState()
ExportPurpose
useWalletState()Reads the connected wallet's address + chain from wagmi context. Non-throwing — returns nullable fields when wagmi isn't mounted.
ConnectWalletConfigThe shape consumed by <StridgeProvider connectWallet>.

The Kit does not re-export wagmi's own hooks — useAccount, useChainId, etc. import from wagmi directly when you need them.

@stridge/kit/format — locale-aware formatters

Pure functions for token / USD / percentage / duration / timestamp formatting. The Kit's own widgets call these internally on payload data; reach for them when you're rendering values outside the Kit's UI but want the same locale behaviour.

import {
  formatTokenAmount,
  formatUsd,
  formatPercent,
  formatDurationCoarse,
  formatDurationCompact,
  formatTimestamp,
  formatNetworkName,
  shortenAddress,
  type FormattedField,
} from "@stridge/kit/format"

Every formatter (except shortenAddress) takes an I18n instance as a second argument — get it from useKitI18n() (Internationalization).

import { useKitI18n } from "@stridge/kit/i18n"
import { formatUsd } from "@stridge/kit/format"

function PriceTag({ value }: { value: number }) {
  const i18n = useKitI18n()
  return <span>{formatUsd(value, i18n)}</span>
}
FunctionOutput
formatTokenAmount(value, i18n, options?)Token amounts with locale-aware decimals and grouping.
formatUsd(value, i18n, options?)USD currency.
formatPercent(value, i18n)Percentages (slippage, fees).
formatDurationCoarse(ms, i18n)"2 hours 30 min" style.
formatDurationCompact(ms, i18n)"02:30:00" timer style.
formatTimestamp(ms, i18n)Locale-aware date / time.
formatNetworkName(chain, i18n)Chain display name.
shortenAddress(address)"0x1234…5678" — no i18n needed.

@stridge/kit/types — exhaustive type catalog

The Kit's main entry exports the types most consumers need (StridgeAppearance, DepositState, WithdrawState, controller types, …). For exhaustive narrowing — every driver payload, every FSM context shape, every settlement DTO, every event union member — reach for @stridge/kit/types:

import type {
  AcceptedAssetPayload,
  AddressItemPayload,
  BalanceItemPayload,
  QuotePayload,
  SettlementPayload,
  ReceiveOptionDto,
  WithdrawableBalanceDto,
  WithdrawalQuoteDto,
  DepositState,
  WithdrawState,
  FailureInfo,
  FailureCode,
  TxRef,
  KitConfig,
  KitTheme,
  KitRadius,
  KitDirection,
  KitStorage,
  KitStorageAdapter,
} from "@stridge/kit/types"

Use this surface when you're:

  • Writing a fully headless integration and want every snapshot field strongly typed.
  • Building analytics or instrumentation that narrows on event payloads.
  • Wrapping the Kit in a service layer and need to type the inputs / outputs.

Storage helpers

For the small set of integrations that need direct access to the Kit's persistence layer (custom storage adapter, multi-tenant namespacing), the main entry exports the building blocks:

import {
  createKitStorage,
  createLocalStorageAdapter,
  createSessionStorageAdapter,
  createMemoryStorageAdapter,
  resolveStorageAdapter,
  DEFAULT_KIT_STORAGE_NAMESPACE,
  KitStorageProvider,
  useKitStorage,
  useKitStorageValue,
} from "@stridge/kit"

Most consumers should pass storage on the provider instead and never touch these directly.

Logos namespace

import { logos, type LogosNamespace } from "@stridge/kit"

logos.tokens.usdc      // convention-driven CDN URL
logos.chains.arbitrum  // same, for chains

logos is a small helper that returns CDN URLs the Kit's TokenLogo / ChainLogo primitives consume. Useful when you want to surface a token or chain logo outside the Kit's UI.

Chain-type helpers

Address-shape validation for the supported chain families:

import {
  type ChainType,
  isValidEvmAddress,
  isValidTronAddress,
  isValidAddressForChainType,
  toChainType,
} from "@stridge/kit"

ChainType is "evm" | "tron" | "unknown". toChainType() normalises a raw chain_type value (incl. the gateway's "TVM" tag for Tron). Address validators are permissive — they check shape, not EIP-55 checksum, matching the gateway's own behaviour.

Next

Was this page helpful?