You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some simple unified Compose Multiplatform wrappers of common components, layouts, and Material Design components for `androidx.compose.material` (officially supported on Android, desktop (JVM), iOS, web (Kotlin/Wasm)) and Compose HTML (mainly based on [Kobweb Silk](https://github.com/varabyte/kobweb?tab=readme-ov-file#silk)and[KMDC](https://github.com/mpetuska/kmdc))
6
+
Unified Compose Multiplatform wrappers of common components, layouts, and Material Design components for `androidx.compose` (officially supported on Android, desktop (JVM), iOS, and web (Kotlin/Wasm)) and Compose HTML (mainly based on [Kobweb Silk](https://github.com/varabyte/kobweb?tab=readme-ov-file#silk)[Compose](https://github.com/varabyte/kobweb/tree/main/frontend/kobweb-compose),[KMDC](https://github.com/mpetuska/kmdc), and [Compose HTML Material](https://github.com/huanshankeji/compose-html-material) (which is then based on [Material Web](https://github.com/material-components/material-web)))
7
7
8
-
<!--a set of APIs for Compose HTML similar to those in `androidx.compose.material`-->
8
+
We try to provide a set of common extensions and composable component APIs akin to those in `androidx.compose` (`androidx.compose.foundation`, `androidx.compose.material`, and `androidx.compose.material3`), meanwhile making them compatible with the Compose HTML APIs. However, only subsets of the composables and composable parameters are supported due to the API differences, limitations of the JS (web) platform and the Compose HTML composables this project depends on, and our limited effort.
9
9
10
-
We try to make the function types of the composable components follow those in `androidx.compose.foundation` and `androidx.compose.material`, meanwhile being compatible with the Compose HTML APIs. However, only subsets of the composables and composable arguments are supported due to the API differences, limitations of the Compose HTML composables this project depends on, and our limited effort.
10
+
Complete visual consistency across different platforms is not guaranteed.
11
11
12
-
Visual consistency across different platforms is not guaranteed.
13
-
14
-
This project is prototype and there is no documentation yet. Check out [the demo project](demo) on how to use the components.
12
+
This project is still in development and has not reached the stable state yet. Some APIs are likely to be changed and there is no detailed documentation yet. Check out [the demo project](demo) on how to use the components in addition to the information below.
15
13
16
14
## Supported features
17
15
18
16
### Components
19
17
20
-
#### Common (Foundation) components
18
+
#### Foundation components
21
19
22
20
-`BasicText`
23
21
@@ -28,46 +26,80 @@ This project is prototype and there is no documentation yet. Check out [the demo
28
26
##### Layouts
29
27
30
28
-`Box`
31
-
-`Column` (via flexbox on web)
32
-
-`Row` (via flexbox on web)
29
+
-`Column` (via flexbox on JS)
30
+
-`Row` (via flexbox on JS)
31
+
-`Spacer`
32
+
33
+
##### Lazy
34
+
35
+
-`LazyColumn`
36
+
-`LazyRow`
33
37
34
-
#### Material components
38
+
#### Material 2 components
35
39
36
40
-`Button`
37
41
-`Card`
42
+
-`Checkbox`
43
+
-`Divider` (not working properly on JS yet)
38
44
-`Icon`
39
45
-`IconButton`
40
-
-`ScrollableList`/`LazyColumn` (visually inconsistent for now)
41
-
-`Text`/`MaterialText`
42
-
-`TextField`
46
+
-`Switch`
47
+
-`Text`
48
+
49
+
##### `ext` components
50
+
51
+
-`Button`
52
+
-`IconButton`
53
+
-`RadioRow`, `RadioGroupRow`
54
+
-`SwitchWithLabel`
55
+
-`MaterialText`, `InlineText`
56
+
-`TextField`, `OutlinedTextField`
43
57
-`TopAppBarScaffold`
44
58
45
-
####Components in the `ext`packages
59
+
##### `lazy.ext`components
46
60
47
-
The components in the `ext` packages don't follow the `androidx.compose` APIs exactly, but rather provide wrappers are idiomatic and conventional on both kinds of targets, wrapping different APIs which can't be unified following the `androidx.compose` APIs.
61
+
-`List`/`LazyColumnList` (visually inconsistent for now)
48
62
49
-
###Styles (obsolete in the legacy module, for removal)
63
+
#### Material 3 components
50
64
51
-
The `ModifierOrAttrsScope.styles` function and the `StyleScope` class provide a universal interface for `Modifier`s and CSS styles.
#### About `ext` components (components in the `ext` packages)
89
+
90
+
The components in the `ext` packages don't follow the `androidx.compose` APIs exactly, but rather provide wrappers are more idiomatic and conventional on both kinds of targets, wrapping different APIs which can't be unified following the `androidx.compose` APIs.
61
91
62
92
### Modifiers
63
93
64
94
- size modifiers
65
-
-`size`, `sizeIn`, `fillMaxSize`
66
-
-`width`, `widthIn`, `fillMaxWidth`
67
-
-`height`, `heightIn`, `fillMaxHeight`
95
+
-`size`, `sizeIn`, `fillMaxSize`
96
+
-`width`, `widthIn`, `fillMaxWidth`
97
+
-`height`, `heightIn`, `fillMaxHeight`
68
98
-`padding`
69
99
-`background`
70
100
-`border` (visually inconsistent)
101
+
-`onClick`
102
+
-`verticalScroll`, `horizontalScroll` (`ScrollState` not supported on JS yet)
View [all the artifacts on Maven Central](https://search.maven.org/search?q=g:com.huanshankeji%20AND%20a:compose-multiplatform-*).
86
133
87
134
This project depends on [Kobweb](https://github.com/varabyte/kobweb) which is not published to Maven Central yet, so you have to add the following Maven repository:
See [the corresponding section in Compose HTML Material](https://github.com/huanshankeji/compose-html-material?tab=readme-ov-file#material-symbols--icons) for configuring Material Icons on JS.
146
+
95
147
## About Kobweb Silk
96
148
97
-
The Kotlin/JS (Compose HTML) portion of this project depends on [Kobweb Compose](https://github.com/varabyte/kobweb/blob/main/frontend/kobweb-compose/README.md) of [Kobweb Silk](https://github.com/varabyte/kobweb?tab=readme-ov-file#silk) which is a UI layer built upon Compose HTML that provides `Modifier`APIs (type-safe CSS API wrappers) and layouts. Here is a list of topics in their README.md that should be helpful when you use this library in Compose HTML:
149
+
The Kotlin/JS (Compose HTML) portion of this project depends on [Kobweb Compose](https://github.com/varabyte/kobweb/blob/main/frontend/kobweb-compose/README.md) of [Kobweb Silk](https://github.com/varabyte/kobweb?tab=readme-ov-file#silk) which is a UI layer built upon Compose HTML that provides `Modifier` (type-safe CSS API wrappers) and layout APIs. Here is a list of topics in their README.md that should be helpful when you use this library in Compose HTML, especially if you need to customize the components further on Kotlin/JS (Compose HTML):
1.[attrsModifier and styleModifier](https://github.com/varabyte/kobweb?tab=readme-ov-file#attrsmodifier-and-stylemodifier)
102
154
1.[General purpose improvements on top of Compose HTML and Kotlin/JS](https://github.com/varabyte/kobweb?tab=readme-ov-file#general-purpose-improvements-on-top-of-compose-html-and-kotlinjs)
103
155
1.[What about Compose Multiplatform for Web?](https://github.com/varabyte/kobweb?tab=readme-ov-file#what-about-compose-multiplatform-for-web)
Copy file name to clipboardExpand all lines: compose-multiplatform-common/src/androidxCommonMain/kotlin/com/huanshankeji/compose/foundation/layout/Column.androidxCommon.kt
Copy file name to clipboardExpand all lines: compose-multiplatform-common/src/androidxCommonMain/kotlin/com/huanshankeji/compose/foundation/layout/Row.androidxCommon.kt
0 commit comments