Customization

You can customize the appearance of the pre-built <NekudaPaymentForm> and individual payment elements by passing a styles object to the <NekudaWalletProvider>. This allows you to define base styles, as well as styles for specific states (such as focus or error) and individual element types.

Refer to the documentation for each element to see available styling selectors and properties.


Building Your Own Form with Individual Elements

For complete control over your payment form’s structure and layout, you can import and use individual payment elements provided by the SDK. This allows you to arrange fields, add custom labels, and integrate them seamlessly into your existing design.

Available elements include:

  • NameElement
  • EmailElement
  • CardNumberElement
  • CardExpiryElement
  • CardCvcElement

Each element component accepts an optional elementId prop.

  • If you provide an elementId, it allows the element to be targeted by instance-specific configurations defined in the <NekudaWalletProvider> (such as custom styles or placeholders via the elements or placeholders props on the Provider). This is useful for advanced customization of specific fields.
  • If you omit the elementId, the element will automatically generate a unique internal ID. It will still inherit type-based styles and global configurations from the Provider but cannot be targeted for instance-specific configurations that rely on a known ID.

All elements also accept style and placeholder props for direct, instance-specific overrides.

Each element securely renders an iframe managed by nekuda to handle sensitive data.

Remember to:

  • Wrap your custom form component (or its ancestor) with <NekudaWalletProvider>.
  • Use the useNekudaWallet() hook to access elements.submit() for form submission.
  • You can pass options (including style) or a direct placeholder prop to individual elements for element-specific styling or placeholders, overriding global settings from the Provider if needed.