Themes
Unit's UI components support multiple Themes.
In order to create a new Theme, you would need to upload a JSON that contains the settings associated with that theme via an API.
In response, you will get a URL. You will then specify that URL as you initialize any UI Component, under the theme attribute.
The best way to understand how to use the themes is to see them in action. Try out the Component Preview page in order to make a Component look and feel like your brand. Once you are happy with the result, you can copy the JSON settings from under the 'Appearance Config' tab in the preview page, and create the theme by uploading the JSON to the API.
After creating the theme, you can use the link from the response to apply the theme to UI components. Here's an example with an account component:
<unit-elements-account
account-id="12345"
customer-token="{{customerToken}}"
theme="https://ui.s.unit.sh/resources/1/themes/291ccb0e-9447-4010-98ef-0b9bf0fd04dc.json"
></unit-elements-account>
Customization Options
The settings that make up a theme are divided into two main categories - global settings and component specific settings.
- Global settings are meant to reflect your brand's design system - colors, fonts, basic component look and feel.
- Component specific settings are meant to allow you to control UI Elements that are unique to a specific Component (e.g. the color of the font on a card image). On the component specific level, you may also provide overrides to any parameter specified in the global settings.
Please reach out to Unit if you need additional customization options to support your brand.
Global Settings
- This object located on the root of the theme JSON object, but it can also be overridden on the component level.
Colors
Typography
| Name | Type | Description |
|---|---|---|
| common | object | Common typography settings (running texts). |
| titles | object | Titles typography settings. |
Common
Titles
| Name | Type | Description |
|---|---|---|
| h2 | Title | The main title used in the Components. Examples include the Card title, Activity table title etc. |
| h3 | Title | The secondary title used in the Components. Examples include menus and empty states. |
| menuTitle | Title | The title used for mobile menus (card-menu, account-list menu, etc). |
| componentTitle | Title | The title applied to various components such as card and activity components. |
| bigNumber | BigNumber | The title used for big number displays in components. |
| flow | Flow | The titles used for a flow or series of steps in a component. (card-actions, payments flows, etc.) |
| response | Response | The titles used for a response or message in components. |
| emptyState | EmptyState | The titles displayed in empty states within component. |
| table | Table | The titles for tables used in components. |
Title
Big Number
Flow
| Name | Type | Description |
|---|---|---|
| title | Title | The main title for the flow. |
| subtitle | Title | The secondary title for the flow. |
Response
| Name | Type | Description |
|---|---|---|
| title | Title | The title for the response. |
Empty State
| Name | Type | Description |
|---|---|---|
| title | Title | The title displayed in the empty state. |
Table
| Name | Type | Description |
|---|---|---|
| headers | Title | The titles for the table headers. |
Buttons
| Name | Type | Description |
|---|---|---|
| fontWeight | 100 , 200 , 300 , 400 , 500 , 600 , 700 , 800 , 900 , 950 , "normal" , "bold" , "bolder" , "lighter" | Font weight for buttons. Omit to use the default. |
| primary | ButtonStates | The primary style of the button. |
| secondary | ButtonStates | A secondary style option for the button. |
| subtle | ButtonStates | A subtle style option for the button. |
| outline | ButtonStates | An outlined style option for the button. |
| flat | ButtonStates | A flat style option for the button. |
Example:
{
"global": {
"buttons": {
"fontWeight": 600
}
}
}
Menu Button
| Name | Type | Description |
|---|---|---|
| default | ButtonAttributes | The default style of the menu button. |
| hover | ButtonAttributes | The style when the button is hovered. |
| active | ButtonAttributes | The style when the button is active. |
| disabled | ButtonAttributes | The style when the button is disabled. |
Button States
| Name | Type | Description |
|---|---|---|
| default | ButtonAttributes | The default style of the menu button. |
| hover | ButtonAttributes | The style when the button is hovered. |
| active | ButtonAttributes | The style when the button is active. |
| disabled | ButtonAttributes | The style when the button is disabled. |
Button Attributes
| Name | Type | Description |
|---|---|---|
| border | Border | The border attributes for the button. |
| textColor | string | The color of the text in the button. |
| backgroundColor | string | The background color of the button. |
Border
| Name | Type | Description |
|---|---|---|
| width | string | The width of the border around the element. |
| radius | string | The border radius or curvature of the element's corners. |
| color | string | The color of the border around the element. |
Menu
Controls the appearance of action menus across components (for example, card actions, account actions, and selection menus).
| Name | Type | Description |
|---|---|---|
| actionItems | object | Action menu item preferences. |
Action Items
| Name | Type | Description |
|---|---|---|
| fontWeight | 100 , 200 , 300 , 400 , 500 , 600 , 700 , 800 , 900 , 950 , "normal" , "bold" , "bolder" , "lighter" | Font weight for menu action items. Omit to use the default. |
Example:
{
"global": {
"menu": {
"actionItems": {
"fontWeight": 600
}
}
}
}
Anchor Button
Controls the default color for anchor buttons (text-style link buttons) across components.
| Name | Type | Description |
|---|---|---|
| defaultColor | string | Default color for anchor buttons. Accepted values: "primary", "neutral". Omit to use the default ("primary"). |
Example:
{
"global": {
"anchorButton": {
"defaultColor": "neutral"
}
}
}
Avatar
| Name | Type | Description |
|---|---|---|
| iconColor | string | Will control the color of the icon. |
| borderColor | string | Will control the color of the border. |
| backgroundColor | string | Will control the color of the background. |
Card Icon
| Name | Type | Description |
|---|---|---|
| backgroundColor | string | Will control the color of the background. |
| visaTextColor | string | Will control the color of the Visa text. |
White Label App Box
Styles the container box used in application form flows.
White Label App Header
Styles the header used in application form flows.
| Name | Type | Description |
|---|---|---|
| actions | object | Header action preferences. |
Actions
| Name | Type | Description |
|---|---|---|
| fontSize | string | Will control the font size of header actions. |
| iconSize | string | Will control the icon size of header actions. |
Sidebar
Controls the color palette for sidebars rendered by Components (for example, the stages sidebar in unit-elements-application-form or unit-elements-create-card). Setting this object re-derives the sidebar's text, border and icon colors from the seed colors, so a dark sidebar stays legible.
| Name | Type | Description |
|---|---|---|
| colors | object | Sidebar color palette. |
Sidebar Colors
Accepts the same shape as the top-level colors palette. The SDK derives the sidebar's text, border and icon colors from these seeds to preserve contrast.
Example — theme-wide sidebar palette (applies everywhere a sidebar is shown):
{
"global": {
"sidebar": {
"colors": {
"primary": "#4F46E5",
"neutral": "#0B1020",
"background": "#0B1020"
}
}
}
}
To scope the palette to a single component (for example, only the Application Form sidebar), set the same object under that component's override.global.sidebar. See Application Form.
Admonition
Controls the appearance of admonition (alert) components used across UI components — for example, informational, success, warning, and error callouts.
Example:
{
"global": {
"admonition": {
"borderWidth": "1px",
"hideBackground": false
}
}
}
Chip
Controls the default rendering style for chip components (for example, status labels on accounts and cards).
| Name | Type | Description |
|---|---|---|
| outline | boolean | When true, chips render with an outlined style (border and transparent background) instead of a filled style. Default is false. |
Example:
{
"global": {
"chip": {
"outline": true
}
}
}
Box
Controls the default rendering style for box (container) components.
| Name | Type | Description |
|---|---|---|
| subtleToOutline | boolean | When true, boxes with the subtle variant render as outlined containers (border with transparent background) instead of filled subtle boxes. Default is false. |
Example:
{
"global": {
"box": {
"subtleToOutline": true
}
}
}
Tabs
Controls the appearance of tab navigation across components.
| Name | Type | Description |
|---|---|---|
| activeColor | string | Accent color for the active tab. Accepted values: "primary", "neutral". Omit to use the default ("neutral"). |
Example:
{
"global": {
"tabs": {
"activeColor": "primary"
}
}
}
Breadcrumbs
Controls the appearance of breadcrumb navigation across components.
| Name | Type | Description |
|---|---|---|
| fontSize | string | Font size for breadcrumb text. Omit to use the default. |
| activeItem | object | Active breadcrumb item preferences. |
Active Item
| Name | Type | Description |
|---|---|---|
| fontWeight | 100 , 200 , 300 , 400 , 500 , 600 , 700 , 800 , 900 , 950 , "normal" , "bold" , "bolder" , "lighter" | Font weight for the active breadcrumb item. Omit to use the default. |
Example:
{
"global": {
"breadcrumbs": {
"fontSize": "14px",
"activeItem": {
"fontWeight": 600
}
}
}
}
Fields
Controls the appearance of form fields (inputs, selects, text areas, and their labels) across components.
| Name | Type | Description |
|---|---|---|
| input | object | Input control preferences. |
| label | object | Field label preferences. |
Input
| Name | Type | Description |
|---|---|---|
| size | string | Input size preset. Accepted values: "small", "medium". Omit to use the default size. |
| border | object | Input border preferences. |
Border
Label
| Name | Type | Description |
|---|---|---|
| fontWeight | string | Font weight for field labels. Accepted values: "bold", "regular". Omit to use the default ("bold"). |
Example:
{
"global": {
"fields": {
"input": {
"size": "medium",
"border": {
"width": "1px",
"radius": "6px"
}
},
"label": {
"fontWeight": "regular"
}
}
}
}
Component Specific Settings
Card
| Name | Type | Description |
|---|---|---|
| designs | Array of Design | The main title used in the Components. Examples include the Card title, Activity table title etc |
| override | Global | The secondary title used in the Components. Examples include menus and empty states |
Card Design
Account
Application Form
Applies to unit-elements-application-form. To recolor the Application Form sidebar without affecting other Components that render a sidebar, set Sidebar colors under override.global.sidebar:
{
"elementsApplicationForm": {
"selectionStageIconsPrimaryColor": true,
"override": {
"global": {
"sidebar": {
"colors": {
"background": "#0B1020",
"neutral": "#0B1020"
}
}
}
}
}
}
| Name | Type | Description |
|---|---|---|
| override | Global | Global overrides scoped to the Application Form, including a sidebar palette. |
| selectionStageIconsPrimaryColor | boolean | When true, icons in the Application Form account-type selection stage use the theme's primary color. Default is false. |
| sidebarBackgroundColor | string | Deprecated. Background color of the Application Form sidebar. Prefer the sidebar palette instead. |
elementsApplicationForm.sidebarBackgroundColor still works but is discouraged. It recolors only the background — sidebar text, borders and icons are not re-derived, so a dark value can produce unreadable content. It exists for backwards-compatibility only.
Prefer setting global.sidebar.colors, or scope it to the Application Form via elementsApplicationForm.override.global.sidebar.colors. These drive the full palette (primary, secondary, neutral, background, info, success, warning, error) and re-derive contrasting text, border and icon colors.
Precedence
When multiple sidebar settings are provided, the background color is resolved in this order (first match wins):
elementsApplicationForm.override.global.sidebar.colors.background— element-scoped palette.global.sidebar.colors.background— theme-wide palette.elementsApplicationForm.sidebarBackgroundColor— legacy, deprecated.
Default Theme
You can set a default theme for all components in the Unit Dashboard under Org Settings → Branding. The dashboard displays all themes created by your organization, and the selected theme will be applied to all components by default unless a specific theme is provided.
Create Theme
Creates theme for UI components.
Creating, updating, and listing themes does not require any scopes. Authenticate with a valid organization API token.
| Verb | POST |
| URL | https://api.s.unit.sh/white-label/theme |
| Data Type | whiteLabelTheme |
| Timeout (Seconds) | 5 |
Attributes
curl -X POST 'https://api.s.unit.sh/white-label/theme'
-H 'Content-Type: application/vnd.api+json'
-H 'Authorization: Bearer ${TOKEN}'
--data-raw '{
"data": {
"type": "whiteLabelTheme",
"attributes": {
"name": "VIP Theme",
"global": {
"colors": {
"background": "#2223334",
"primary": "#0000F0",
"secondary": "#000000",
"neutral": "#FF9933",
"success": "#0CD96F",
"warning": "#FF9933",
"error": "#FF4F64"
},
"typography": {
"common": {
"fontFamily": "sans-serif"
},
"titles": {
"h2": {
"fontWeight": "800"
},
"h3": {
"fontWeight": "800"
}
}
}
},
"elementsCard": {
"designs": [
{
"name": "default",
"url": "https://d1xlopvhx2cz8k.cloudfront.net/resources/outlay.png",
"fontColor": "#00ff00",
"boxShadow": "0px 3.6px 15px 2px rgb(0 0 0 / 0.25)"
}
]
},
"elementsAccount": {
"override": {
"global": {
"colors": {
"background": "#00ff00"
}
}
}
},
"elementsPayment": {
"override": {
"global": {
"typography": {
"common": {
"fontFamily": "Poppins"
}
}
}
}
}
}
}
}'
Response
Response is a JSON:API document.
201 Created
| Name | Type | Description |
|---|---|---|
| data | object | The requested resource after the operation was completed. |
| links | object | Related Link object with url to be used in component. |
Related
| Name | Type | Description |
|---|---|---|
| type | String | Type of the resource in link. |
| href | object | URL to be set in theme property of component. |
{
"data": {
"type": "whiteLabelTheme",
"id": "10008",
"attributes": {
"...": "..."
},
"links": {
"related": {
"type": "application/json",
"href": "https://ui.s.unit.sh/resources/982/themes/605676c1-b00b-4748-9fa4-258d1a28c3fb.json"
}
}
}
}
Update Theme
Updates theme for UI components.
You need to send the full theme object in the request body, not only the fields that were changed.
| Verb | PUT |
| URL | https://api.s.unit.sh/white-label/theme/{id} |
| Data Type | whiteLabelTheme |
| Timeout (Seconds) | 5 |
curl --request PUT 'https://api.s.unit.sh/white-label/theme/{id}' \
--header 'Content-Type: application/vnd.api+json' \
--data-raw '{
"data": {
"type": "whiteLabelTheme",
"attributes": {
"name": "VIP Theme",
"global": {
"colors": {
"background": "#2223334",
"primary": "#0000F0",
"secondary": "#000000",
"neutral": "#FF9933",
"success": "#0CD96F",
"warning": "#FF9933",
"error": "#FF4F64"
},
"typography": {
"common": {
"fontFamily": "sans-serif"
},
"titles": {
"h2": {
"fontWeight": "800"
},
"h3": {
"fontWeight": "800"
}
}
}
},
"elementsCard": {
"designs": [
{
"name": "default",
"url": "https://d1xlopvhx2cz8k.cloudfront.net/resources/outlay.png",
"fontColor": "#00ff00",
"boxShadow": "0px 3.6px 15px 2px rgb(0 0 0 / 0.25)"
}
]
},
"elementsAccount": {
"override": {
"global": {
"colors": {
"background": "#00ff00"
}
}
}
},
"elementsPayment": {
"override": {
"global": {
"typography": {
"common": {
"fontFamily": "Poppins"
}
}
}
}
}
}
}
}'
Get Theme
Get theme by id.
| Verb | GET |
| URL | https://api.s.unit.sh/white-label/theme/{id} |
| Data Type | whiteLabelTheme |
| Timeout (Seconds) | 5 |
curl -X GET 'https://api.s.unit.sh/white-label/theme/{id}' \
-H "Authorization: Bearer ${TOKEN}"
List
List themes resources. Paging and sorting can be applied.
| Verb | GET |
| URL | https://api.s.unit.sh/white-label/theme |
| Timeout (Seconds) | 5 |
Query Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| page[limit] | integer | 100 | Optional. Maximum number of resources that will be returned. Maximum is 1000 resources. See Pagination. |
| page[offset] | integer | 0 | Optional. Number of resources to skip. See Pagination. |
| filter[fileName] | string | (empty) | Optional. Find by file name. |
| sort | string | sort=-createdAt | Optional. sort=createdAt for ascending order or sort=-createdAt (leading minus sign) for descending order. |
curl -X GET 'https://api.s.unit.sh/white-label/theme?page[limit]=20&page[offset]=10' \
-H "Authorization: Bearer ${TOKEN}"