Customization Basics
Configuration file
Our UIKit v4 supports customization in a single place by modifying a config.json file in related UIKit repository. This configuration file includes all necessary data to customize the appearance of each pages, components and elements that we allow to do customization.
Global Theme
Applying a theme to application
UIKit will support preferred_theme property in configuration.
defaultrespects the device settings.lightforcefully set light theme regardless of device settings.darkforcefully set dark theme regardless of device settings.
"preferred_theme": "default"Available color properties in Light and Dark theme
We support light and dark theme, you can modify primary, secondary, base and shaded colors, alert and background colors for your app theme.
primary- primary color for the app, used for action button and highlighted text.secondary- secondary color for the app, used for border and secondary action button.base- used as primary text color in title, label and body.base_shade1- used as secondary text color in description, slightly lighter thanbasecolor inlighttheme and slightly dimmer thanbasecolor indarktheme.base_shade2- used as tertiary text color in secondary description, inactive and hint text, slightly lighter thanbase_shade1color inlighttheme and slightly dimmer thanbase_shade1color indarktheme.base_shade3- used as disabled text color, slightly lighter thanbase_shade2color inlighttheme and slightly dimmer thanbase_shade2color indarktheme.base_shade4- optional, slightly lighter thanbase_shade3color inlighttheme and slightly dimmer thanbase_shade3color indarktheme.alert- used for error button and text.background- used for background color of the page or component.
"theme": {
"light": {
"primary_color": "#1054DE",
"secondary_color": "#292B32",
"base_color": "#292b32",
"base_shade1_color": "#636878",
"base_shade2_color": "#898e9e",
"base_shade3_color": "#a5a9b5",
"base_shade4_color": "#ebecef",
"alert_color": "#FA4D30",
"background_color": "#FFFFFF",
},
"dark": {
"primary_color": "#1054DE",
"secondary_color": "#292B32",
"base_color": "#ebecef",
"base_shade1_color": "#a5a9b5",
"base_shade2_color": "#6e7487",
"base_shade3_color": "#40434e",
"base_shade4_color": "#292b32",
"alert_color": "#FA4D30",
"background_color": "#191919",
}
}Configuration ID of Page, Component, and Element
We support three different levels - Page, Component, and Element. The format is like page_id/component_id/element_id.
Page ID - We use post suffix and placed at first, it will look like camera_page/*/*
Component ID - We use component suffix and placed in the middle, it will look like */comment_component/*
Element ID - We use no suffix and placed at last, it will look like */*/close_button
Customizing Page
You can override Global Theme for a specific page with the desired value like below
"camera_page/*/*": {
"theme": {
"light": {
"primary_color": "#1054DE",
"secondary_color": "#292B32",
"base_color": "#292b32",
"base_shade1_color": "#636878",
"base_shade2_color": "#898e9e",
"base_shade3_color": "#a5a9b5",
"base_shade4_color": "#ebecef",
"alert_color": "#FA4D30",
"background_color": "#FFFFFF",
},
"dark": {
"primary_color": "#1054DE",
"secondary_color": "#292B32",
"base_color": "#ebecef",
"base_shade1_color": "#a5a9b5",
"base_shade2_color": "#6e7487",
"base_shade3_color": "#40434e",
"base_shade4_color": "#292b32",
"alert_color": "#FA4D30",
"background_color": "#191919",
}
}
}Allowed Page IDs
These are the available Page IDs
"select_target_page/*/*"
"camera_page/*/*"
"creat_story_page/*/*"
"story_page/*/*"Customizing Component
You can also override Global Theme for a specific component with the desired value like below
"*/edit_comment_component/*": {
"theme": {
"light": {
"primary_color": "#1054DE",
"secondary_color": "#292B32",
"base_color": "#292b32",
"base_shade1_color": "#636878",
"base_shade2_color": "#898e9e",
"base_shade3_color": "#a5a9b5",
"base_shade4_color": "#ebecef",
"alert_color": "#FA4D30",
"background_color": "#FFFFFF",
},
"dark": {
"primary_color": "#1054DE",
"secondary_color": "#292B32",
"base_color": "#ebecef",
"base_shade1_color": "#a5a9b5",
"base_shade2_color": "#6e7487",
"base_shade3_color": "#40434e",
"base_shade4_color": "#292b32",
"alert_color": "#FA4D30",
"background_color": "#191919",
}
}
}Allowed Component IDs
These are the available Component IDs
"*/edit_comment_component/*"
"*/comment_tray_component/*"
"*/story_tab_component/*"Customizing Element
You can specify background_color for an element, and icon if that element has an image icon.
"create_story_page/*/aspect_ratio_button": {
"aspect_ratio_icon": "aspect_ratio.png",
"background_color": "#80000000"
}Allowed Component IDs
These are the available Component IDs
"select_target_page/*/back_button"
"camera_page/*/close_button"
"create_story_page/*/back_button"
"create_story_page/*/aspect_ratio_button"
"create_story_page/*/story_hyperlink_button"
"create_story_page/*/hyper_link"
"create_story_page/*/share_story_button"
"story_page/*/progress_bar"
"story_page/*/overflow_menu"
"story_page/*/close_button"
"story_page/*/story_impression_button"
"story_page/*/story_comment_button"
"story_page/*/story_reaction_button"
"story_page/*/create_new_story_button"
"story_page/*/speaker_button"
"*/edit_comment_component/cancel_button"
"*/edit_comment_component/save_button"
"*/hyper_link_config_component/*"
"*/hyper_link_config_component/done_button"
"*/hyper_link_config_component/cancel_button"
"*/story_tab_component/story_ring"
"*/story_tab_component/create_new_story_button"
"*/*/close_button"Excluding page, component, or element
You can exclude UI elements by specifying their config id in excludes in the configuration file.
Example: Excluding the aspect ratio button from the Story Draft page
"excludes": [
"create_story_page/*/aspect_ratio_button"
]Last updated
Was this helpful?