A Kotlin multiplatform library for building dynamic server-driven UI

Overview

Component Box · GitHub license PRs Welcome

A Kotlin multiplatform library for building dynamic server-driven UI.

  • Material Component-Based
  • Interoperable
  • Dynamic
  • What You See Is What You Get

Component Box Desktop

Learn how to use Component Box in your project.

Installation

implementation("com.dropbox.componentbox:componentbox:0.1.0")

Documentation

You can find Component Box documentation on the website.

Check out the Getting Started page for a quick overview.

Examples

class Screen(
    private val componentBoxUrl: String,
    private val presenter: ComponentBoxPresenter,
    private val context: Context
): ComponentBoxFragment()
@Composable
fun Screen() {
    val zipline = ComponentBoxZipline(getZiplineUrl(), getScript())
    val presenter = ComponentBoxPresenter(zipline)

    ComponentBoxView(
        componentBoxUrl = getComponentBoxUrl(),
        presenter = presenter,
        context = getContext(),
        Loading = { Loading() },
        Fallback = { Fallback() }
    )
}

Contributing

Evolving Component Box is the main reason we published this repository. PRs are welcome!

Contributing Guide

Read our contributing guide to learn about our development process, how to propose fixes and enhancements, and how to build and test your changes.

Good First Issues

Start with one of our good first issues!

License

Copyright (c) 2022 Dropbox, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
Yummies is my first attempt at building a native iOS app using Swift and SwiftUI

Yummies is my first attempt at building a native iOS app using Swift and SwiftUI. A recipe browser where you can pin your favorite ones. Powered by Edamam Recipe Search API.

A package for building sentence-based UI in SwiftUI
A package for building sentence-based UI in SwiftUI

SentenceUI SentenceUI is an SwiftUI package for building form interfaces with natural language. Features The goal for SentenceUI is to make it as easy

React Native library that implements PayPal Checkout flow using purely native code (swift).
React Native library that implements PayPal Checkout flow using purely native code (swift).

react-native-paypal-swift React Native library that implements PayPal Checkout flow using purely native code (swift). Installation npm install react-n

A Swift library for Panasonic AMG88 Grid-EYE thermopile sensors.

AMG88xx A Swift library for the Panasonic AMG88 family of sensors. Summary This library can read temperature data from the AMG88 thermopile sensor. Us

Swift library for parsing Extended Backus–Naur Form (EBNF) notation

Gramophone Swift library for parsing Extended Backus–Naur Form (EBNF) notation Integration Swift Package Manager dependencies: [ .package(url: "ht

A testing MQTT react native library

react-native-awesome-testing abc Installation npm install react-native-awesome-testing Usage import { multiply } from "react-native-awesome-testing";

Personal plug-in library

PPILibrary Personal plug-in library 功能介绍 Core 核心基础扩展, 不依赖于任何三方库 使用 根据subspec指定 pod 'PPILibrary', :subspecs = ['Core'], :git = 'https://github.com/Sh

🐦 An asynchronous Twitter library based on the Twitter v2 API

Twift Twift is an asynchronous Swift library for the Twitter v2 API. No external dependencies Only one callback-based method (requestUserCredentials)

Keybase Go Library, Client, Service, OS X, iOS, Android, Electron
Keybase Go Library, Client, Service, OS X, iOS, Android, Electron

Keybase Hi, and welcome to the Keybase client repo. All our client apps (macOS, Windows, Linux, iOS, and Android) are being actively developed in this

Comments
  • Sample Android app crashes on Plans screen

    Sample Android app crashes on Plans screen

    E/AndroidRuntime: FATAL EXCEPTION: Zipline
        Process: com.dropbox.componentbox.discovery, PID: 3219
        app.cash.zipline.QuickJsException: Only KClass supported as classifier, got C
            at JavaScript.vc(zipline)
            at JavaScript.ph(zipline)
            at JavaScript.b$(zipline)
            at JavaScript.kk(zipline)
            at JavaScript.hk(zipline)
            at JavaScript.<anonymous>(zipline)
            at JavaScript.kk(zipline)
            at JavaScript.hk(zipline)
            at JavaScript.AC(zipline)
            at JavaScript.<anonymous>(zipline)
            at JavaScript.<anonymous>(zipline)
            at JavaScript.<anonymous>(zipline)
            at JavaScript.<anonymous>(zipline)
            at JavaScript.tj(zipline)
            at JavaScript.<anonymous>(zipline)
            at JavaScript.<anonymous>(zipline)
            at JavaScript.<eval>(?)
            at app.cash.zipline.QuickJs.evaluate(Native Method)
            at app.cash.zipline.QuickJs.evaluate(QuickJs.kt:110)
            at app.cash.zipline.QuickJs.evaluate$default(QuickJs.kt:109)
            at com.dropbox.componentbox.discovery.zipline.ComponentBoxZipline$produceModelsIn$job$1.invokeSuspend(ComponentBoxZipline.kt:41)
            at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
            at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
            at java.lang.Thread.run(Thread.java:920)
    
    bug 
    opened by matt-ramotar 3
  • https://componentbox.io/ doesn't load

    https://componentbox.io/ doesn't load

    https://componentbox.io/ and related links in the README such as

    https://github.com/dropbox/componentbox/blob/d0e81c4227ae66c1478be91a2bb01c2bd0cd5257/README.md?plain=1#L18

    do not load, seems the domain doesn't point to anything

    $ dig componentbox.io
    
    ; <<>> DiG 9.16.1-Ubuntu <<>> componentbox.io
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34169
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 512
    ;; QUESTION SECTION:
    ;componentbox.io.               IN      A
    
    ;; AUTHORITY SECTION:
    componentbox.io.        300     IN      SOA     ns-cloud-a1.googledomains.com. cloud-dns-hostmaster.google.com. 3 21600 3600 259200 300
    
    ;; Query time: 116 msec
    ;; SERVER: 192.168.8.1#53(192.168.8.1)
    ;; WHEN: Fri Mar 04 19:17:45 PST 2022
    ;; MSG SIZE  rcvd: 137
    
    documentation 
    opened by ScottBrenner 1
  • Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xb4000073957bc580 in tid 11408 (DefaultDispatch), pid 11383 (mples.campaigns)

    Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xb4000073957bc580 in tid 11408 (DefaultDispatch), pid 11383 (mples.campaigns)

    Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xb4000073957bc580 in tid 11408 (DefaultDispatch), pid 11383 (mples.campaigns)
    2022-12-14 23:52:40.392 11430-11430 DEBUG                   crash_dump64                         A  Cmdline: com.dropbox.componentbox.samples.campaigns
    2022-12-14 23:52:40.392 11430-11430 DEBUG                   crash_dump64                         A  pid: 11383, tid: 11408, name: DefaultDispatch  >>> com.dropbox.componentbox.samples.campaigns <<<
    2022-12-14 23:52:40.392 11430-11430 DEBUG                   crash_dump64                         A        #00 pc 0000000000027524  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/base.apk!libquickjs.so (BuildId: e223aa6b91b8fe2f75ad53f138b2fb4a5751dd5d)
    2022-12-14 23:52:40.392 11430-11430 DEBUG                   crash_dump64                         A        #01 pc 000000000003b9cc  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/base.apk!libquickjs.so (BuildId: e223aa6b91b8fe2f75ad53f138b2fb4a5751dd5d)
    2022-12-14 23:52:40.392 11430-11430 DEBUG                   crash_dump64                         A        #02 pc 0000000000018bcc  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/base.apk!libquickjs.so (BuildId: e223aa6b91b8fe2f75ad53f138b2fb4a5751dd5d)
    2022-12-14 23:52:40.392 11430-11430 DEBUG                   crash_dump64                         A        #05 pc 00000000004879d2  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/oat/arm64/base.vdex (app.cash.zipline.QuickJs.execute+14)
    2022-12-14 23:52:40.392 11430-11430 DEBUG                   crash_dump64                         A        #07 pc 0000000000489c7e  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/oat/arm64/base.vdex (app.cash.zipline.internal.QuickJsExtensionsKt.loadJsModule+94)
    2022-12-14 23:52:40.392 11430-11430 DEBUG                   crash_dump64                         A        #09 pc 00000000004883f6  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/oat/arm64/base.vdex (app.cash.zipline.Zipline.loadJsModule+26)
    2022-12-14 23:52:40.392 11430-11430 DEBUG                   crash_dump64                         A        #11 pc 00000000004964d0  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/oat/arm64/base.vdex (app.cash.zipline.loader.internal.InternalJniKt.multiplatformLoadJsModule+32)
    2022-12-14 23:52:40.392 11430-11430 DEBUG                   crash_dump64                         A        #13 pc 000000000049b6c2  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/oat/arm64/base.vdex (app.cash.zipline.loader.internal.receiver.ZiplineLoadReceiver.receive+50)
    2022-12-14 23:52:40.392 11430-11430 DEBUG                   crash_dump64                         A        #15 pc 0000000000491d28  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/oat/arm64/base.vdex (app.cash.zipline.loader.ZiplineLoader$ModuleJob$run$3.invokeSuspend+112)
    2022-12-14 23:52:40.392 11430-11430 DEBUG                   crash_dump64                         A        #17 pc 0000000000491c9c  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/oat/arm64/base.vdex (app.cash.zipline.loader.ZiplineLoader$ModuleJob$run$3.invoke+16)
    2022-12-14 23:52:40.392 11430-11430 DEBUG                   crash_dump64                         A        #19 pc 0000000000491c70  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/oat/arm64/base.vdex (app.cash.zipline.loader.ZiplineLoader$ModuleJob$run$3.invoke+8)
    2022-12-14 23:52:40.392 11430-11430 DEBUG                   crash_dump64                         A        #21 pc 00000000005c2ef0  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/oat/arm64/base.vdex (kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn+28)
    2022-12-14 23:52:40.392 11430-11430 DEBUG                   crash_dump64                         A        #23 pc 0000000000583b90  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/oat/arm64/base.vdex (kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext+128)
    2022-12-14 23:52:40.392 11430-11430 DEBUG                   crash_dump64                         A        #25 pc 0000000000583d68  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/oat/arm64/base.vdex (kotlinx.coroutines.BuildersKt.withContext+0)
    2022-12-14 23:52:40.392 11430-11430 DEBUG                   crash_dump64                         A        #27 pc 0000000000491f4e  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/oat/arm64/base.vdex (app.cash.zipline.loader.ZiplineLoader$ModuleJob.run+370)
    2022-12-14 23:52:40.392 11430-11430 DEBUG                   crash_dump64                         A        #29 pc 0000000000491c30  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/oat/arm64/base.vdex (app.cash.zipline.loader.ZiplineLoader$ModuleJob$run$1.invokeSuspend+28)
    2022-12-14 23:52:40.392 11430-11430 DEBUG                   crash_dump64                         A        #31 pc 0000000000543d46  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/oat/arm64/base.vdex (kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith+42)
    2022-12-14 23:52:40.393 11430-11430 DEBUG                   crash_dump64                         A        #33 pc 0000000000588dec  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/oat/arm64/base.vdex (kotlinx.coroutines.DispatchedTask.run+444)
    2022-12-14 23:52:40.393 11430-11430 DEBUG                   crash_dump64                         A        #35 pc 0000000000f0532e  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/oat/arm64/base.vdex (kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely+2)
    2022-12-14 23:52:40.393 11430-11430 DEBUG                   crash_dump64                         A        #37 pc 0000000000f0403e  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/oat/arm64/base.vdex (kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask+34)
    2022-12-14 23:52:40.393 11430-11430 DEBUG                   crash_dump64                         A        #39 pc 0000000000f0416c  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/oat/arm64/base.vdex (kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker+56)
    2022-12-14 23:52:40.393 11430-11430 DEBUG                   crash_dump64                         A        #41 pc 0000000000f0411c  /data/app/~~D6MquTqnlmLVHIRFHs5nKQ==/com.dropbox.componentbox.samples.campaigns-MRzoVeIn4E-fdqpPIvRctQ==/oat/arm64/base.vdex (kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run+0)
    
    opened by matt-ramotar 1
Releases(0.2.0-alpha0.2)
Kotlin Multiplatform sample with SwiftUI and Compose (Desktop and Android) clients. Heavily inspired by Wordle game.

WordMasterKMP Kotlin Multiplatform sample heavily inspired by Wordle game and also Word Master and wordle-solver samples. The main game logic/state is

John O'Reilly 56 Oct 4, 2022
Kotlin Multiplatform project that gets network data from Food2Fork.ca

Food2Fork Recipe App This is the codebase for a Kotlin Multiplatform Mobile course. Watch the course List to Detail screen Searching Architecture Shar

Mitch Tabian 317 Dec 30, 2022
Kotlin Multiplatfom app for Droidcon Events

Sessionize/Droidcon Mobile Clients General Info This project has a pair of native mobile applications backed by the Sessionize data api for use in eve

Touchlab 838 Jan 4, 2023
Static Native Template and Dynamic Styling without any other app release

FileManager Project Students and Freshers, Good opportunity for you to learn and contribute in this project. Here you would learn how you can change t

Naveen Chauhan 3 Nov 30, 2021
Create dynamic wallpapers for macOS

Equinox Create macOS native wallpapers Description Equinox is an application that allows you to create macOS native wallpapers. Starting macOS Mojave

Dmitry Meduho 683 Jan 5, 2023
A dynamic sitemap generator for Vapor

A dynamic sitemap generator for Vapor

Vapor Community 5 Apr 21, 2022
Example how to make, update and end Live Activity. With Dynamic Island and Lock Screen.

Live Activity Example Example how to make, update and end Live Activity. With Dynamic Island and Lock Screen. Full tutorial available at sparrowcode.i

Sparrow Code 9 Dec 8, 2022
Turbo-iOS base project that's entirely driven from your backend Rails app.

Turbo-iOS base project that's entirely driven from your backend Rails app.

Dale Zak 109 Dec 11, 2022
The most powerful Event-Driven Observer Pattern solution the Swift language has ever seen!

Event-Driven Swift Decoupling of discrete units of code contributes massively to the long-term maintainability of your project(s). While Observer Patt

Flowduino 4 Nov 14, 2022
A Swift package that provides convenient Lorem Ipsum text, images, colors and other placeholders for rapidly prototyping, building and testing your iOS applications.

Lorem Introducing Lorem, a placeholder generator library for iOS to help you rapidly prototype, build and test your iOS applications. By leveraging Sw

Thirdfort Limited 10 Dec 5, 2022