Page cover image

👋Overview

CraftD: A framework to implement Server-Driven UI quickly and easily to Android / iOS / Flutter / Km

Features

🔗 Compatibility

Tech
Support

View System - Android

Supported

Jetpack Compose - Android

Supported

Widget - Flutter

Supported

SwiftUi - iOS

Supported

Jetpack Compose - Multiplatform

⚒️ In Progress

Components that already exist in the library

Component
Compose
View System
Widget
SwiftUI

Button

X

X

X

-

Text

X

X

X

X

CheckBox

X

-

-

-

Create your custom component( android compose example )

@JsonIgnoreProperties(ignoreUnknown = true)
@Immutable
@Stable
data class CheckBoxProperties(
    @JsonProperty("text") val text: String? = null,
    ... rest of your properties
)

Add your Component json object in Dymanic.json

{
  "key": "CraftDCheckBox",
  "value": {
    ... rest of your properties
  }
}

Create your Component

@Composable
fun CraftDCheckBox(
    checkboxProperties: CheckBoxProperties,
    modifier: Modifier = Modifier,
    onChecked: (Boolean) -> Unit
) {
    ... Rest of your code
}

Create your Component Builder

class CraftDCheckBoxBuilder(
    override val key: String = CraftDComponentKey.CHECK_BOX_COMPONENT.key
) :
    CraftDBuilder {
    @Composable
    override fun craft(model: SimpleProperties, listener: CraftDViewListener) {
        val checkBoxProperties = model.value.convertToVO<CheckBoxProperties>()
        CraftDCheckBox(checkBoxProperties) {
            checkBoxProperties.actionProperties?.let { listener.invoke(it) }
        }
    }
}

More details check our itens

Samples

Credits

A Server Driven UI library for Android.

Inspired by the DynamicView.

🛠️Setup

Get Started

We've put together some helpful guides for you to get setup with our product quickly and easily.

💡How to use

Last updated