For teams who need deeper styling control while staying within the UIKit framework. Component Styling allows you to override CSS, customize individual components, and implement advanced theming.Documentation Index
Fetch the complete documentation index at: https://learn.social.plus/llms.txt
Use this file to discover all available pages before exploring further.
Styling Control
Override styles with custom config json
Component Targeting
Customize specific components and pages
Advanced Theming
Complex color schemes and typography
UIKit Framework
Still within the UIKit ecosystem
When to Choose Component Styling
Component Styling is ideal when you need: ✅ Custom brand experiences - Basic colors and fonts✅ Granular control - Target specific components or pages
✅ Advanced theming - Complex color schemes and typography
✅ Framework benefits - Want to stay within UIKit’s ecosystem ❌ Simple branding -
Dynamic UI is easier for basic needs❌ Complex layouts -
Fork & Extend offers more freedom❌ Custom components - Need source code access for new components
Configuration Model
Component Styling uses a single
config.json surface for cross-platform overrides. It layers on top of default UIKit tokens (and Dynamic UI if present) using a path pattern: page_id/component_id/element_id with wildcards (*).Path Pattern & Levels
| Level | Example | Description | Wildcard Use |
|---|---|---|---|
| Page | camera_page/*/* | Entire screen / route | Replace component & element with */* |
| Component | */comment_tray_component/* | Functional unit within a page | Wildcard page to apply globally |
| Element | story_page/*/close_button | Single interactive / visual element | Wildcard component for all instances |
Supported Theme Tokens
| Token | Purpose | Notes |
|---|---|---|
| primary_color | Actions / highlights | High contrast vs background |
| secondary_color | Secondary actions / borders | Complementary to primary |
| base_color | Primary text color | Body & headings |
| base_shade1_color | Secondary text | Subtitles / meta |
| base_shade2_color | Tertiary text / hints | Placeholders, inactive |
| base_shade3_color | Disabled text | Low emphasis |
| base_shade4_color | Optional faint text / separators | Lowest emphasis |
| alert_color | Errors / destructive | Distinct from brand palette |
| background_color | Surface background | Page / component surface |
Minimal Config Skeleton
Theme Application & Preferred Mode
Set the app’s theme resolution strategy withpreferred_theme:
| Value | Behavior |
|---|---|
| default | Follow OS setting (light/dark) |
| light | Force light regardless of OS |
| dark | Force dark regardless of OS |
Targeting Examples
Page-Level
Page-Level
Override a whole screen. Great for hero / camera / immersive surfaces.
Component-Level
Component-Level
Adjust reusable functional blocks everywhere.
Element-Level
Element-Level
Fine-grain tweak for single control.
Reference: Allowed IDs
- Pages
- Components
- Elements (Partial)
Exclusions
Remove (hide) specific elements by adding their path toexcludes:
Precedence & Conflict Resolution
| Scenario | Winning Value |
|---|---|
| Page vs Global | Page override |
| Component vs Page | Component override |
| Element vs Component | Element override |
| Multiple matches same level | Last in file (bottom-most) |
Custom Config File (iOS)
iOS only. On Android, Flutter, and React Native, the config JSON is loaded differently per platform. On iOS, use
setConfigFile to load a local JSON file from your app bundle at initialisation time.config.json. setConfigFile lets you supply a replacement from your own app bundle — useful for per-environment configs, white-label builds, or shipping your own defaults without modifying UIKit source.
Implementation
| Parameter | Type | Description |
|---|---|---|
filePath | String | Absolute path to your config.json file. Use Bundle.path(forResource:ofType:) to resolve it safely. |
Custom Asset Bundle (iOS)
iOS only. On Android, Flutter, and React Native, image overrides are handled through the
config.json element keys (e.g. “close_icon”: “close.png”).config.json, iOS lets you supply a custom Bundle containing your own images. UIKit uses it as a fallback — your assets are loaded only for image names that do not exist in UIKit’s own bundle.
How It Works
UIKit bundle checked first
If the image name exists in UIKit’s own bundle, that version is always used.
Custom bundle as fallback
Only when the name is not found in UIKit’s bundle does it fall through to your registered custom bundle.
Implementation
- Basic Setup
- With Config File
- Dedicated Bundle
Call
setCustomAssetBundle once during app initialisation, after AmityUIKit4Manager.setup(client:).Troubleshooting
Image is not showing
Image is not showing
Verify the asset is included in the bundle you registered:Check that the file name, extension, and capitalisation match exactly what is referenced in
config.json.UIKit is displaying its default icon instead of mine
UIKit is displaying its default icon instead of mine
An asset with the same name in UIKit’s bundle always wins. Rename your asset uniquely and update the matching
config.json icon key to point to the new name.Works in Debug but missing in Release
Works in Debug but missing in Release
Ensure the image file appears under Copy Bundle Resources in Build Phases. Loose PNG/PDF files (not inside an
.xcassets catalog) must be added manually.Best Practices
Token First
Change global tokens before per-element overrides.
Progressive Specificity
Escalate from page → component → element only when needed.
Consistency
Reuse colors; avoid random hex proliferation.
Auditable Changes
Document rationale in PR descriptions.
Dark Mode QA
Visually inspect every high-contrast surface.
Minimal Exclusions
Prefer styling adjustments over removal.
Overriding Navigation Behaviour
Navigation can be customized without forking by overriding the provided Behaviour classes. UIKit isolates navigation & event hooks into behaviour objects per page/component so you can inject custom flows (e.g., presenting a different creation screen, analytics, guards) while keeping styling overrides separate.
Behaviour Architecture
- Each major screen/component exposes a
Behaviour(iOS) /Behavior(Android) class with overridable navigation methods. - A top-level
AmityUIKit4Manager.behaviour(iOS) /AmityUIKit4Manager.behavior(Android) aggregates these instances. - Replace only the concrete behaviour you need; leave others at default.
Override Example
Advanced iOS Navigation (Swipe Back & SwiftUI Hosting)
UIKit v4 pages are predominantly SwiftUI, embedded inUINavigationController via helper controllers:
| Class | Purpose |
|---|---|
AmitySwiftUIHostingController | Wrap a single SwiftUI view |
AmitySwiftUIHostingNavigationController | Provide a navigation stack hosting SwiftUI pages |
AmitySwipeToBackGestureBehavior.
Keep gesture logic lightweight—long operations here can block UI responsiveness.
When to Escalate
If navigation changes require altering internal view composition (e.g., embedding a new container architecture), consider moving to Fork & Extend. Simple route substitutions, analytics, permission gates, and gesture tweaks belong here.Next Steps
Dynamic UI
Remote token updates
Advanced Customization
Fork & extend source