Skip to content

Commit

Permalink
fix: UI docs
Browse files Browse the repository at this point in the history
  • Loading branch information
DannyOnfido committed Feb 12, 2024
1 parent 0c55794 commit 5f0eca2
Showing 1 changed file with 43 additions and 13 deletions.
56 changes: 43 additions & 13 deletions UI_CUSTOMIZATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@

The Web SDK supports customization options across the SDK screen including text, the SDK main container, buttons, links, icon background color and popups. For visualizations of the available options please see our [SDK customization guide](https://developers.onfido.com/guide/sdk-customization#web).

- **`customUI {Object} optional`**
- **`theme.name`**
Currently we only support a light theme

```js
theme: {
name: "light",
config: {
// Your configuration options
}
}
```

- **`theme.config {Object} optional`**

To customize the SDK, you can pass the corresponding CSS values to the `customUI` object for the following options:
To customize the SDK, you can pass the corresponding CSS values to the `theme.config` object for the following options:

| Typography options | Description |
| ---------------------- | ---------------------------------------------------------------------------------- |
Expand All @@ -24,11 +36,14 @@ The Web SDK supports customization options across the SDK screen including text,
Example configuration with typography options:

```javascript
customUI: {
"fontFamilyTitle": "Impact, fantasy",
"fontSizeTitle": "26px",
"fontWeightSubtitle": 600,
"fontSizeSubtitle": "1.25rem",
theme: {
name: "light",
config: {
"fontFamilyTitle": "Impact, fantasy",
"fontSizeTitle": "26px",
"fontWeightSubtitle": 600,
"fontSizeSubtitle": "1.25rem",
}
}
```

Expand All @@ -45,12 +60,15 @@ The Web SDK supports customization options across the SDK screen including text,
Example configuration with Modal options:

```javascript
customUI: {
theme: {
name: "light",
config: {
"colorBackgroundSurfaceModal": "#fafafa",
"colorBorderSurfaceModal": "rgb(132 59 98)",
"borderWidthSurfaceModal": "6px",
"borderStyleSurfaceModal": "groove",
}
}
```

| Primary Buttons | Description |
Expand Down Expand Up @@ -99,7 +117,9 @@ The Web SDK supports customization options across the SDK screen including text,
Example configuration with Button options:

```javascript
customUI: {
theme: {
name: "light",
config: {
"colorContentButtonPrimaryText": "#333",
"colorBackgroundButtonPrimary": "#ffb997",
"colorBorderButtonPrimary": "#B23A48",
Expand All @@ -112,6 +132,7 @@ The Web SDK supports customization options across the SDK screen including text,
"colorBackgroundButtonSecondaryHover": "#ce6a85",
"colorBackgroundButtonSecondaryActive": "#985277",
}
}
```

The following options are applied to multiple Button elements:
Expand All @@ -124,10 +145,13 @@ The Web SDK supports customization options across the SDK screen including text,
Example configuration:

```javascript
customUI: {
theme: {
name: "light",
config: {
borderRadiusButton: "50px",
buttonGroupStacked: true
}
}
```

| Links | Description |
Expand Down Expand Up @@ -179,12 +203,18 @@ The Web SDK supports customization options across the SDK screen including text,
The following fonts are available:

- [Overpass](https://fonts.google.com/specimen/Overpass)
- [Roboto](https://fonts.google.com/specimen/Roboto)
- [Poppins](https://fonts.google.com/specimen/Poppins)
- [Wix Madefor Text](https://fonts.google.com/specimen/Wix+Madefor+Text)
- To request support for additional fonts, please reach out to your Customer Support Manager or email [Onfido Support](mailto:support@onfido)\*

```javascript
customUI: {
"googleFonts": ["Overpass"],
"fontFamilyTitle": "'Overpass', sans-serif",
"theme": {
"name": "light",
"config": {
"googleFonts": ["Overpass"],
"fontFamilyTitle": "'Overpass', sans-serif",
}
}
```

Expand Down

0 comments on commit 5f0eca2

Please sign in to comment.