Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/2.0.0 #38

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Compose Shadow

A Kotlin Multiplatform implementation of drop shadows for Compose Multiplatform.
A Kotlin Multiplatform implementation of drop/inner shadows for Compose Multiplatform.

This library will continue to be maintained until this is officially supported in Compose.

Expand All @@ -12,8 +12,8 @@ This library will continue to be maintained until this is officially supported i

| `compose-shadow` | CMP | Kotlin |
|------------------|---------------|--------|
| 2.0.0 | 1.7.1 | 2.0.21 |
| 1.0.0 | 1.7.0-rc01 | 2.0.21 |
| 0.0.1 | 1.7.0-dev1743 | 2.0.0 |

## Installation

Expand All @@ -28,15 +28,16 @@ implementation("com.adamglin:compose-shadow:$version")
1. [x] Android (SDK > 28)
2. [x] iOS
3. [x] Desktop (JVM)
4. [x] JS/Wasm

## Usage

Apply and customize shadow using the `dropShadow` Modifier:

### Drop Shadow
```kotlin
Box(
Modifier
.size(50.dp)
.dropShadow(
shape = RectangleShape,
color = Color.Black.copy(.5f),
Expand All @@ -48,8 +49,24 @@ Box(
.background(Color.White),
)
```
### Inner Shadow
```kotlin
Box(
Modifier
.innerShadow(
shape = RectangleShape,
color = Color.Black.copy(.5f),
offsetX = 4.dp,
offsetY = 4.dp,
blur = 10.dp,
spread = 5.dp,
)
.background(Color.White),
)
```
## Sample
We provided this address [here](https://adamglin0.github.io/compose-shadow/sample/index.html) for viewing the wasm online examples.

### Screenshots
<img width="300" alt="image" src="https://github.com/user-attachments/assets/36d15219-d4ea-4de9-84fe-df2cbceb0e2e">
<img width="300" alt="image" src="https://github.com/user-attachments/assets/cf1b42d1-5d92-4259-93a6-f0883b7d9dc7">
Expand Down
2 changes: 1 addition & 1 deletion compose-shadow/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ mavenPublishing {
coordinates(
groupId = "com.adamglin",
artifactId = "compose-shadow",
version = "1.0.0"
version = "2.0.0"
)
pom {
name.set("compose-shadow")
Expand Down
Loading