Skip to content

Commit e4566dd

Browse files
committed
Update README.md throughly
1 parent cf57bc8 commit e4566dd

File tree

2 files changed

+49
-30
lines changed

2 files changed

+49
-30
lines changed

LEGACY_README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Legacy README
2+
3+
This file contains information on legacy code which is not removed yet.
4+
5+
## Supported features
6+
7+
### Styles
8+
9+
The `ModifierOrAttrsScope.styles` function and the `StyleScope` class provide a universal interface for `Modifier`s and CSS styles.
10+
11+
The functions in `StyleScope`:
12+
13+
- `height`
14+
- `margin`
15+
- `width`
16+
- `backgroundColor`
17+
- `platformBorder`
18+
- `outerBorder`

README.md

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
# Compose Multiplatform common extensions and Material wrappers for `androidx.compose.material` and Compose HTML
1+
# Compose Multiplatform Material: unified Compose Multiplatform common extensions and Material wrappers for `androidx.compose` and Compose HTML
22

3-
[![Maven Central](https://img.shields.io/maven-central/v/com.huanshankeji/compose-multiplatform-material)](https://search.maven.org/search?q=g:com.huanshankeji%20AND%20a:compose-multiplatform-*)
4-
![Kotlin version](https://kotlin-version.aws.icerock.dev/kotlin-version?group=com.huanshankeji&name=compose-multiplatform-material)
3+
[![Maven Central](https://img.shields.io/maven-central/v/com.huanshankeji/compose-multiplatform-material3)](https://search.maven.org/search?q=g:com.huanshankeji%20AND%20a:compose-multiplatform-*)
4+
![Kotlin version](https://kotlin-version.aws.icerock.dev/kotlin-version?group=com.huanshankeji&name=compose-multiplatform-material3)
55

6-
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) [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)))
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)))
77

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.
99

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.
1111

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.
1513

1614
## Supported features
1715

@@ -28,8 +26,8 @@ This project is prototype and there is no documentation yet. Check out [the demo
2826
##### Layouts
2927

3028
- `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)
3331
- `Spacer`
3432

3533
##### Lazy
@@ -91,25 +89,12 @@ This project is prototype and there is no documentation yet. Check out [the demo
9189

9290
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.
9391

94-
### Styles (obsolete in the legacy module, for removal)
95-
96-
The `ModifierOrAttrsScope.styles` function and the `StyleScope` class provide a universal interface for `Modifier`s and CSS styles.
97-
98-
The functions in `StyleScope`:
99-
100-
- `height`
101-
- `margin`
102-
- `width`
103-
- `backgroundColor`
104-
- `platformBorder`
105-
- `outerBorder`
106-
10792
### Modifiers
10893

10994
- size modifiers
110-
- `size`, `sizeIn`, `fillMaxSize`
111-
- `width`, `widthIn`, `fillMaxWidth`
112-
- `height`, `heightIn`, `fillMaxHeight`
95+
- `size`, `sizeIn`, `fillMaxSize`
96+
- `width`, `widthIn`, `fillMaxWidth`
97+
- `height`, `heightIn`, `fillMaxHeight`
11398
- `padding`
11499
- `background`
115100
- `border` (visually inconsistent)
@@ -129,26 +114,42 @@ Maven coordinate:
129114
"com.huanshankeji:compose-multiplatform-$module:$version"
130115
```
131116

117+
For example, depend on the Material 3 module with Gradle:
118+
119+
```kotlin
120+
kotlin {
121+
sourceSets {
122+
commonMain {
123+
dependencies {
124+
// ...
125+
implementation("com.huanshankeji:compose-multiplatform-material3:$version")
126+
}
127+
}
128+
}
129+
}
130+
```
131+
132132
View [all the artifacts on Maven Central](https://search.maven.org/search?q=g:com.huanshankeji%20AND%20a:compose-multiplatform-*).
133133

134134
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:
135135

136136
```kotlin
137137
repositories {
138+
mavenCentral()
138139
maven("https://us-central1-maven.pkg.dev/varabyte-repos/public")
139140
}
140141
```
141142

142143
### Material Symbols & Icons on JS
143144

144-
See [the corresponding section in Compose HTML Material](https://github.com/huanshankeji/compose-html-material?tab=readme-ov-file#material-symbols--icons) for Material Icons on JS.
145+
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.
145146

146147
## About Kobweb Silk
147148

148149
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):
149150

150151
1. [Silk](https://github.com/varabyte/kobweb?tab=readme-ov-file#silk)
151-
1. [Modifier](https://github.com/varabyte/kobweb?tab=readme-ov-file#modifier)
152-
1. [attrsModifier and styleModifier](https://github.com/varabyte/kobweb?tab=readme-ov-file#attrsmodifier-and-stylemodifier)
152+
1. [Modifier](https://github.com/varabyte/kobweb?tab=readme-ov-file#modifier)
153+
1. [attrsModifier and styleModifier](https://github.com/varabyte/kobweb?tab=readme-ov-file#attrsmodifier-and-stylemodifier)
153154
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)
154155
1. [What about Compose Multiplatform for Web?](https://github.com/varabyte/kobweb?tab=readme-ov-file#what-about-compose-multiplatform-for-web)

0 commit comments

Comments
 (0)