Skip to content

Commit 5c06394

Browse files
committed
docs: create README.md file for renderer modules
1 parent 62b6a60 commit 5c06394

File tree

3 files changed

+109
-2
lines changed

3 files changed

+109
-2
lines changed

docs/create-renderer.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,4 @@ JsonForm(
113113
```
114114

115115
For more details, see the [API reference](api/index.html) and the source code of the
116-
[Material3](../renderers/material3/) and [Cupertino](../renderers/cupertino/) renderers for
117-
inspiration.
116+
material3 and cupertino modules.

renderers/cupertino/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Cupertino Renderer
2+
3+
This module provides a Cupertino-style renderer. It enables you to render dynamic forms using
4+
Cupertino (Apple-like) components, fully compatible with Kotlin Multiplatform and Compose
5+
Multiplatform projects.
6+
7+
## Usage
8+
9+
Add the dependency to your project:
10+
11+
```kotlin
12+
dependencies {
13+
implementation("com.paligot.jsonforms.kotlin:cupertino:<version>")
14+
}
15+
```
16+
17+
In your Compose code, use the Cupertino renderer functions in the `JsonForm` component:
18+
19+
```kotlin
20+
import com.paligot.jsonforms.cupertino.*
21+
22+
JsonForm(
23+
schema = schema,
24+
uiSchema = uiSchema,
25+
state = formState,
26+
layoutContent = { CupertinoLayout(content = it) },
27+
stringContent = { scope ->
28+
CupertinoStringProperty(
29+
value = formState[scope.id].value as String?,
30+
error = formState.error(scope.id).value,
31+
onValueChange = { formState[scope.id] = it }
32+
)
33+
},
34+
numberContent = { scope ->
35+
CupertinoNumberProperty(
36+
value = formState[scope.id].value as String?,
37+
error = formState.error(scope.id).value,
38+
onValueChange = { formState[scope.id] = it }
39+
)
40+
},
41+
booleanContent = { scope ->
42+
CupertinoBooleanProperty(
43+
value = formState[scope.id].value as Boolean? ?: false,
44+
onValueChange = { formState[scope.id] = it }
45+
)
46+
}
47+
)
48+
```
49+
50+
## Reference
51+
52+
- [Usage guide](../../docs/usage.md)
53+
- [Custom rendering guide](../../docs/custom-rendering.md)
54+
- [Create a renderer guide](../../docs/create-renderer.md)

renderers/material3/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Material3 Renderer
2+
3+
This module provides a Material Design 3 (Material You) renderer. It enables you to render dynamic
4+
forms using Material3 components, fully compatible with Kotlin Multiplatform and Compose
5+
Multiplatform projects.
6+
7+
## Usage
8+
9+
Add the dependency to your project:
10+
11+
```kotlin
12+
dependencies {
13+
implementation("com.paligot.jsonforms.kotlin:material3:<version>")
14+
}
15+
```
16+
17+
In your Compose code, use the Material3 renderer functions in the `JsonForm` component:
18+
19+
```kotlin
20+
import com.paligot.jsonforms.material3.*
21+
22+
JsonForm(
23+
schema = schema,
24+
uiSchema = uiSchema,
25+
state = formState,
26+
layoutContent = { Material3Layout(content = it) },
27+
stringContent = { scope ->
28+
Material3StringProperty(
29+
value = formState[scope.id].value as String?,
30+
error = formState.error(scope.id).value,
31+
onValueChange = { formState[scope.id] = it }
32+
)
33+
},
34+
numberContent = { scope ->
35+
Material3NumberProperty(
36+
value = formState[scope.id].value as String?,
37+
error = formState.error(scope.id).value,
38+
onValueChange = { formState[scope.id] = it }
39+
)
40+
},
41+
booleanContent = { scope ->
42+
Material3BooleanProperty(
43+
value = formState[scope.id].value as Boolean? ?: false,
44+
onValueChange = { formState[scope.id] = it }
45+
)
46+
}
47+
)
48+
```
49+
50+
## Reference
51+
52+
- [Usage guide](../../docs/usage.md)
53+
- [Custom rendering guide](../../docs/custom-rendering.md)
54+
- [Create a renderer guide](../../docs/create-renderer.md)

0 commit comments

Comments
 (0)