Guides
...
USAGE AND BILLING PORTAL
Embeddable UI Kit - React.js

React.js Widgets

42min

Here is the list of all the available components that you can integrate into your own React.js application.





Available Widgets

All widgets use internally some hooks to retrieve and update data. You can subscribe to them, to show loading or errors statuses. Or just to get the raw data to render in the format you desire. (Advanced). You can read more about hooks here

Each view has linked the hooks that is consuming, so you can subscribe to them.

Cost And Billed Usage

Document image

Document image

Document image

Document image


How to import:

import { CostAndBilledUsage } from '@amberflo/uikit'

Available Props

To see common props check ReactJS Integration | Common Props



Document image

Document image

Document image

Document image


Used Hooks

Cost Explorer Bar Graph

Document image


How to import: import { CostExplorerBarGraph } from "@amberflo/uikit";

Available Props

There are no specific props for this view. To see common props check ReactJS Integration | Common Props

Used Hooks

Cost Table

Document image


How to import:

import { CostExplorerTable } from '@amberflo/uikit'

Available Props

To see common props check ReactJS Integration | Common Props

Document image


Included Units

Document image


How to import: import { IncludedUnits } from '@amberflo/uikit'

Available Props

To see common props check ReactJS Integration | Common Props 

Document image


Used hooks

Credits Ledger

Document image




Document image


How to import: import { CreditsLedger } from "@amberflo/uikit";

Available Props

To see common props check ReactJS Integration | Common Props

Document image


Used Hooks

Invoice Details

Document image


How to import:

import { InvoiceDetails } from '@amberflo/uikit'

Available Props

To see common props check ReactJS Integration | Common Props

Document image

Document image

Document image

Document image


-Note: Invoice data displayed in this component is affected by Invoice-related options.

Used Hooks

Invoice PDF

Document image


How to import:

import { InvoicePdf } from '@amberflo/uikit'

Available Props

To see common props check ReactJS Integration | Common Props

Document image

Document image

Document image


Note: Invoice data displayed in this component is affected by Invoice-related options.

Used Hooks

Invoices List

Document image


How to import:

import { InvoicesList } from '@amberflo/uikit'

Available Props

To see common props check ReactJS Integration | Common Props

Document image


Note: Invoice data displayed in this component is affected by Invoice-related options.

Used Hooks

Orders Usage Graph and Table

Document image


How to import:

import { OrdersUsageGraphAndTable } from '@amberflo/uikit'

To see common props check ReactJS Integration | Common Props. The following Common Props are not available for this component: callToAction, title, withContainer and withTitle. The ReactJS Integration | Common Graph Props are also available for this component.

Used Hooks

Prepaid Summary Graph

Document image


How to import:

import { PrepaidSummaryGraph } from '@amberflo/uikit'

Available Props

To see common props check ReactJS Integration | Common Props

Document image


Used Hooks

Prepaid Summary Table

Document image


How to import:

import { PrepaidSummaryTable } from '@amberflo/uikit'

Available Props

To see common props check ReactJS Integration | Common Props

Document image


Used Hooks

Pricing Plan

Document image


How to import:

import { PricingPlan } from '@amberflo/uiki'

To see common props check ReactJS Integration | Common Props

Document image


Used Hooks

Pricing Plan Summary

Document image


How to import: import { PricingPlanSummary } from '@amberflo/uikit'

Available Props

To see common props check ReactJS Integration | Common Props

Document image


Used Hooks

Usage Graph

Document image


How to import:

import { UsageByMeterLineGraph } from '@amberflo/uikit'

Available Props

To see common props check ReactJS Integration | Common Props

Document image

Document image

Document image

Document image


Used Hooks

Usage Table

Document image


How to import:

import { UsageByMeterTable } from '@amberflo/uikit'

Available Props

To see common props check ReactJS Integration | Common Props

Document image


Used Hooks

Order List

Document image


How to import:

import { OrderList } from '@amberflo/uikit'

Available Props

To see common props check ReactJS Integration | Common Props

Document image


Order Create

Document image




Document image


How to import:

import { OrderCreate } from '@amberflo/uikit'

Available Props

To see common props check ReactJS Integration | Common Props

Document image


Order Details

Document image


How to import:

import { OrderDetails } from '@amberflo/uikit'

Available Props

To see common props check ReactJS Integration | Common Props

Document image


Orders Usage Graph and Table

Document image


How to import:

import { OrdersUsageGraphAndTable } from '@amberflo/uikit'

Available Props

To see common props check ReactJS Integration | Common Props

To see graph props check ReactJS Integration | Graph Props

Stripe Setup Intent

Document image




Document image


How to import:

import { StripeSetupIntent } from '@amberflo/uikit'

Available Props

To see common props check ReactJS Integration | Common Props

Document image


After the payment method is set. A redirect will happen to the returnUrl. It can be the same url as the actual one.

If the redirect url, has this component included, even if hidden, it will automatically set the default payment method. If not, read below how to set the default payment method.

How To Get Secret Key From Stripe

Call this endpoint:

📘 POST

Payload:

{ "provider": "stripe" }

Response Body:

{ "id": "seti_1LIBSbFZnIN3GxYXnNiuvLGe", "clientSecret": "seti_3MKDTdHBpKP5IzAZpNiuvLGe_secret_M0BqOmOj5LWcKZ910nPEzRCy1wFfe8M" }

How to make a payment the default payment method

  1. After creating a new payment method, you’ll get redirected to a new URL with some query string parameters. The redirect is needed in order to get the query param called setup_intent_client_secret to retrieve payment method from Stripe.
  2. You need to retrieve the payment method from Stripe, by running: const setupIntentClientSecret = getQueryString("setup_intent_client_secret"); const { setupIntent } = await stripe.retrieveSetupIntent(setupIntentClientSecret);
  3. Submit the payment method to endpoint to set as default payment method:

📘POST



Payload

{ provider: "stripe", paymentMethodId: <Payment method ID from Stripe>, }

If on the redirect url, you place the StripeSetupIntentcomponent, even if hidden, it will trigger automatically the set default payment method.

You can also subscribe to usePaymentMethod() hook from @maberflo/uikit/hooks, like:

JS


This isSuccess will change to true after setting the payment method.

Common Props

These are props common to all views, and non of them are required:

Document image

Document image


Common Date Picker Props

There are a few props shared by views that have a date picker. And none of them are required.

Views with date picker:

Shared props:

Document image


Common Graph Props

There are a few props shared by views that have a graph. And none of them are required.

Views with graphs:

Shared props:

Name

Type

Default

Description

graphTextColor

string

undefined

Color for the axis of graphs

customGraphOptions

ChartOptions

undefined

We use Chart.js for our graphs. This prop allows to customize the graph using all the options they provide. For more info check: https://www.chartjs.org/docs/latest/general/options.html For example, you could change text colors, lines or bars weight, add animations, etc.



Updated 31 Jul 2024
Did this page help you?