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
Copy file name to clipboardExpand all lines: docs/components/card.md
+39-16Lines changed: 39 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,17 @@
1
1
# Card
2
2
3
-
`Card` is a basic container component in Miuix, used to hold related content and actions. It provides a card container with Miuix style, suitable for scenarios such as information display and content grouping.
3
+
`Card` is a basic container component in Miuix, used to hold related content and actions. It provides a card container with Miuix style, suitable for scenarios such as information display and content grouping. Supports both static display and interactive modes.
4
4
5
5
## Import
6
6
7
7
```kotlin
8
8
importtop.yukonga.miuix.kmp.basic.Card
9
+
importtop.yukonga.miuix.kmp.utils.PressFeedbackType// If using interactive card
9
10
```
10
11
11
12
## Basic Usage
12
13
13
-
The Card component can be used to wrap and organize content:
14
+
The Card component can be used to wrap and organize content (static card):
14
15
15
16
```kotlin
16
17
Card {
@@ -22,30 +23,38 @@ Card {
22
23
23
24
### Card Properties
24
25
25
-
| Property Name | Type | Description | Default Value | Required |
Copy file name to clipboardExpand all lines: docs/guide/utils.md
+76Lines changed: 76 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,82 @@ LazyColumn(
105
105
*`springDamp`: Float, defines the spring damping for the rebound animation. Higher values result in less oscillation. Defaults to `1f`.
106
106
*`isEnabled`: A lambda expression returning a Boolean, used to dynamically control whether the overscroll effect is enabled. By default, it is enabled only on Android and iOS platforms.
107
107
108
+
## Press Feedback Effects
109
+
110
+
Miuix provides visual feedback effects to enhance user interaction experience, improving operability through tactile-like responses.
111
+
112
+
### Sink Effect
113
+
114
+
The `pressSink` modifier applies a "sink" visual feedback when the component is pressed, by smoothly scaling down the component.
115
+
116
+
```kotlin
117
+
val interactionSource = remember { MutableInteractionSource() }
The `pressTilt` modifier applies a "tilt" effect based on the position where the user pressed the component. The tilt direction is determined by touch offset, giving the effect that one corner "sinks" while the other "static".
131
+
132
+
```kotlin
133
+
val interactionSource = remember { MutableInteractionSource() }
Press feedback effects require detecting `interactionSource.collectIsPressedAsState()` to be triggered.
147
+
148
+
You can use responsive modifiers like `Modifier.clickable()` to add `PressInteraction.Press` to the `interactionSource` and trigger press feedback effects.
149
+
150
+
However, it's recommended to use the method below to add `PressInteraction.Press` to the `interactionSource` for faster response triggering of press feedback effects.
151
+
152
+
```kotlin
153
+
val interactionSource = remember { MutableInteractionSource() }
0 commit comments