Embeddable UI Kit - React.js
Embeddable UI components for React.js applications
The Amberflo UI Kit is a React component library for Amberflo accounts to be able to consume and make use of principal Amberflo views, for one of their customers, on their own site.
If you are trying to use this widgets on a non React.js environment, you can use the vanilla.js library as well.
Run yarn add @amberflo/uikit or npm install @amberflo/uikit to install Amberflo UI Kit in your React project.
📘Technologies
React >= v17.0.2 Node v16.13.1 Typescript v4.5.5
All versions can be found on npm repository: @amberflo/uikit
The AmberfloProvider is a Provider component that needs to wrap your app, so the components can hit our API. It requires a customer-specific session and a theme. You can check here how to:
To import a single Amberflo UI Kit component into your application (Recommended):
In order to customize components with a theme add a theme prop to the AmberfloProvider with the following object:
We have added some class names to most of our components, you will be able to identify them, once they are placed on your app, by the starting name of aflo-. You can use this classes along with the material UI classes in your own css file.
So for instance, if you want to set a dark mode, to make it look something like this:
You can add some styles like:
This way you can change the text color for the whole components to white. And in the buttons that have a light background, we can set a dark color as black.
Amberflo UI Kit is heavily typed, which will allow, if you use typescript on your project, to easily see which kind of properties a component receives, or what would return a specific function or hook.
There are a few UI Kit components that display invoice-related data (i.e. Invoice List, Invoice Details, Invoice PDF). There are invoice-related settings a user can update at Amberflo | Settings | Invoice which affect how invoices are displayed through UI Kit components (as well as the customer portal and in the main-app).
The current available option/settings are:
- Displaying cached invoices
- Invoice data displayed will either be cached data or real-time data.
- Cached data is used to speed up how quickly invoice data can be retrieved.
- Group product items on invoices
- We list all product items and allow user to create categories to group on the invoices.
Read how to use the widgets, views and components in here.
Read how to use hooks in here