Skip to main content

React Components (@nowramp/form)

The @nowramp/form package provides ready-to-use React components for crypto on/off-ramp checkout. It handles currency selection, quote comparison, wallet input, and provider checkout — all within your app, no iframe needed.

Installation

@nowramp/form has peer dependencies on react and react-dom (18+). The @nowramp/sdk package is bundled automatically.

Quick Start


RampForm Component

The main component that renders the complete checkout form with currency selection, quote comparison, wallet input, and provider checkout.

Basic Usage (Partner Dashboard Pattern)

This is the minimal setup used in partner dashboard integrations:

Full Branding (Hosted Checkout Pattern)

For hosted checkout flows with complete brand customization:

Props Reference

Core Props

Default Values

Theme & Styling

UI Controls

Display Customization

Field Locks

Callbacks


RampProvider + useRamp

For full control over the UI, use RampProvider for state management and build your own components.

RampProvider

Wraps your custom UI with configuration, API state, and form management.

useRamp Hook

Access the full ramp context within a RampProvider.

RampFormState

RampStep Values


Data Hooks

Standalone hooks for direct API access without the full form UI. Use these to build completely custom checkout experiences.

useRampConfig

Fetches supported gateways, currencies, and payment methods.
Returns:

useQuotes

Fetches and ranks quotes from all enabled gateways. Auto-refreshes when params change.
Pass null as the second argument to skip fetching (useful when form inputs are incomplete). Returns:

useCheckoutIntent

Creates a checkout order with a selected gateway.
Returns:

useTransaction

Polls transaction status until it reaches a terminal state.
The initialDelay option is useful when embedding a provider checkout iframe — it gives the user time to complete payment before polling starts.
Returns:

Theming

Light / Dark Mode

Custom Colors

Override individual colors for precise brand matching:
Color mapping guide:

Skin Presets

Skins apply a coordinated set of colors and styles. Available skins are exported from the package as SKINS.

Standalone Mode (IIFE)

For non-React apps (plain HTML, PHP, WordPress, etc.), use the standalone IIFE build.
The mount function accepts the same props as the RampForm component.

Next.js Integration

Always use the 'use client' directive in Next.js App Router since @nowramp/form uses React hooks and browser APIs.

Next Steps

Multi-Provider Quotes

Build a custom quote comparison UI

Onramp API

API reference for all onramp endpoints

JavaScript SDK

Direct API access without React

Callback URLs

Server-side transaction notifications