Component Box - a multiplatform server-driven UI framework

Overview

Component Box · GitHub license PRs Welcome

Component Box is a multiplatform server-driven UI framework.

Learn how to use Component Box in your project.

Installation

implementation("com.dropbox.componentbox:componentbox:0.0.1-alpha")
implementation("com.dropbox.componentbox:util:0.0.1-alpha")

Documentation

You can find Component Box documentation on the website.

Check out the Getting Started page for a quick overview.

Examples

@Composable
actual fun Component.Inflate() {
    when (this) {
        is Component.Box -> this.Inflate()
        is Component.Button -> this.Inflate()
        is Component.Column -> this.Inflate()
        is Component.Drawable -> this.Inflate()
        is Component.Row -> this.Inflate()
        is Component.Switch -> this.Inflate()
        is Component.Text -> this.Inflate()
        is Component.Vector -> this.Inflate()
    }
}
fun Component.Column.Inflate() {
    val customModifiers = listOf(
        Modifier.background(this.modifier?.background.color())
    )

    Column(
        verticalArrangement = verticalArrangement.vertical(),
        horizontalAlignment = horizontalAlignment.horizontal(),
        modifier = this.modifier.build(customModifiers)
    ) {
        this.components?.forEach { component ->
            component.Inflate()
        }
    }
}

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...
A declarative framework for building efficient UIs on Android.
A declarative framework for building efficient UIs on Android.

Litho Litho is a declarative framework for building efficient UIs on Android. Declarative: Litho uses a declarative API to define UI components. You s

MacOS theme for JetBrains Compose UI framework
MacOS theme for JetBrains Compose UI framework

MacOS theme for Compose Multiplatform MacOS theme written in Compose UI. Create native looking UIs for Mac using Compose UI. Share your UI code to run

A Lightweight Framework for Code Generating

Codegen A lightweight framework for code generating. Why Codegen? In Java/Kotlin world, engineers usually use JavaPoet or KotlinPoet for code generati

Safaricom internal session  on Server driven Ui. This is an example of Server driven UI with jetpack Compose
Safaricom internal session on Server driven Ui. This is an example of Server driven UI with jetpack Compose

Jetpack Compose Server Driven UI Server Driven UI This is a demo application for a session at Safaricom to demostrate Server driven UI using Jetpack C

An introductory dynamics to Test Driven Development (TDD)An introductory dynamics to Test Driven Development (TDD)

tdd-demo Nesse hands-on teremos uma dinâmica introdutória a Test Driven Development (TDD), ou desenvolvimento orientado por testes. instruções 1 - Clo

Beagle is an open-source framework for cross-platform development using the concept of Server-Driven UI.
Beagle is an open-source framework for cross-platform development using the concept of Server-Driven UI.

Beagle Getting Started · Learn the Basics · Contribute Beagle is an open-source framework for cross-platform development using the concept of Server-D

Jetpack Compose component box.
Jetpack Compose component box.

Jetpack Compose Component Box About The Project ℹ️ This project is a project where you can find and use custom components in Jetpack Compose. Our goal

Simple chat box written in kotlin, requires a redis server
Simple chat box written in kotlin, requires a redis server

Chat Box A simple chat box written in kotlin which requires a redis server to be used. Features Command Support Online User storage in Redis Easy to u

A motion-driven animation framework for Android.
A motion-driven animation framework for Android.

Backboard A motion-driven animation framework for Android. backboard is a framework on top of rebound that makes it easier to use by coupling it to vi

Powerful, elegant and flexible test framework for Kotlin with additional assertions, property testing and data driven testing
Powerful, elegant and flexible test framework for Kotlin with additional assertions, property testing and data driven testing

Kotest is a flexible and comprehensive testing tool for Kotlin with multiplatform support. To learn more about Kotest, visit kotest.io or see our quic

Repo of the Open Source Android library : RoboSpice. RoboSpice is a modular android library that makes writing asynchronous long running tasks easy. It is specialized in network requests, supports caching and offers REST requests out-of-the box using extension modules. Material Design text field that comes in a box, based on (OLD) Google Material Design guidelines.
Material Design text field that comes in a box, based on (OLD) Google Material Design guidelines.

TextFieldBoxes A new Material Design text field that comes in a box, based on Google Material Design guidelines. 🇨🇳 中文看这里 UPDATE NOTICE 1.4.5 Releas

A sleek, out of the box, easy to understand and use, swipe gesture based Navigational Library for android.
A sleek, out of the box, easy to understand and use, swipe gesture based Navigational Library for android.

Facilis Swipe gesture based navigational library for Android. Watch Demo Video: Getting Started To get this project into your build: Gradle Add it in

Modern About Box for an Android App
Modern About Box for an Android App

About Box A modern About Box for an Android App built on the daniel-stoneuk/material-about-library. Easily display the common items of an About Box in

Easily upload files (Multipart/Binary/FTP out of the box) in the background with progress notification. Support for persistent upload requests, customizations and custom plugins.
Easily upload files (Multipart/Binary/FTP out of the box) in the background with progress notification. Support for persistent upload requests, customizations and custom plugins.

ℹ️ 🆕 Get started with 4.x 👉 Try it out Get the demo APK Still using 3.x ? It's not maintained or supported. You may have security issues and problem

Unified API Library for: Cloud Storage, Social Log-In, Social Interaction, Payment, Email, SMS, POIs, Video & Messaging. Included services are Dropbox, Google Drive, OneDrive, OneDrive for Business, Box, Egnyte, PayPal, Stripe,  Google Places, Foursquare, Yelp, YouTube, Vimeo, Twitch, Facebook Messenger, Telegram, Line, Viber, Facebook, GitHub, Google+, LinkedIn, Slack, Twitter, Windows Live, Yahoo, Mailjet, Sendgrid, Twilio, Nexmo, Twizo.
Sample source code for Android Pride Rainbow Bounding Box written in Kotlin and OpenGL 🏳️‍🌈

Sample Code for Animated Rainbow Bounding Box in OpenGL A sample app showing how to draw a rainbow bounding box on Android with OpenGL and Kotlin. Blo

An android library through which users can add a customized loading dialog box with Lottie Animations.
An android library through which users can add a customized loading dialog box with Lottie Animations.

CustomLottieDialogBox About CustomLottieDialogBox is an android library which facilitate developers to add customized loading Dialog-Boxes to their an

Android virtual box

简介 本项目基于济宁市罗盒网络科技有限公司2017年12月已停止更新的开源代码VirtualApp,以及第三方作者tinycode1的VirtualBox开源项目进行开发。 本项目发布符合GPL3.0协议及任何符合第7条的附加条件 本项目同时也遵循GPL-3.0 License,进行开源 警告 1.

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)
Owner
Dropbox
Dropbox
Modern About Box for an Android App

About Box A modern About Box for an Android App built on the daniel-stoneuk/material-about-library. Easily display the common items of an About Box in

Quality Mobile Puzzle Apps 91 Nov 11, 2022
Multiplatform UI DSL with screen management in common code for mobile (android & ios) Kotlin Multiplatform development

Mobile Kotlin widgets This is a Kotlin MultiPlatform library that provides declarative UI and application screens management in common code. You can i

IceRock Development 320 Dec 30, 2022
[] A fast PDF reader component for Android development

This project is no longer maintained. You can find a good replacement here, which is a fork relying on Pdfium instead of Vudroid/MuPDF for decoding PD

Joan Zapata 2.8k Dec 16, 2022
(Deprecated) A custom view component that mimics the new Material Design Bottom Navigation pattern.

BottomBar (Deprecated) I don't have time to maintain this anymore. I basically wrote the whole library in a rush, without tests, while being a serious

Iiro Krankka 8.4k Dec 29, 2022
Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube graphic component.

Draggable Panel DEPRECATED. This project is not maintained anymore. Draggable Panel is an Android library created to build a draggable user interface

Pedro Vicente Gómez Sánchez 3k Dec 6, 2022
Library and example project on how to use the UITableView component

UITableView for Android Usage Installation Android Studio Paste or clone this library into the /libs folder, in the root directory of your project. Cr

Thiago Locatelli 679 Nov 11, 2022
A tinder like swipeable card stack component

AndroidSwipeableCardStack Change log: provide option to infinitly swipe in a loop card rotation setting card gravity setting undo animation Thanks for

wenchao jiang 824 Nov 10, 2022
A backport of the SwitchPreference component that was introduced on Android 4 (ICS / level 14). This port works on Android 2.1+ (Eclair MR1 / level 7).

Android Switch Preference Backport A backport of the SwitchPreference component that was introduced on Android 4 (ICS / level 14). This port works on

Benoit Lubek 498 Dec 29, 2022
Android App that communicates with a back-end server to display different One Piece characters

About This project is an Android App that communicates with a back-end server to display different One Piece characters. It's roughly based on this co

Sam Garcia 1 Feb 4, 2022
Thin multiplatform wrappers for graphics.

Kotlin Graphics Libraries Kotlin Multiplatform libraries for graphics. GLFW Vulkan OpenGL STB KGL uses LWJGL for the JVM target and the respective nat

Dominic Fischer 91 Dec 10, 2022