Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
3 changes: 3 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
./gradlew :miuix:dokkaGenerate
mkdir -p ./docs/public/dokka
mv ./miuix/build/dokka/html/* ./docs/public/dokka
./gradlew :docs:demo:jsBrowserDistribution
mkdir -p ./docs/public/compose
mv ./miuix/docs/demo/build/dist/js/productionExecutable/* ./public/docs/compose
cd ./docs
yarn install
yarn docs:build
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ docs/node_modules
docs/.vitepress/dist
docs/.vitepress/cache
docs/public/dokka
docs/public/compose
4 changes: 4 additions & 0 deletions docs/components/basiccomponent.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

This project builds upon it to provide some extended components, enabling developers to quickly create UI components that conform to design specifications. See the usage of [Extended Components](../components/#extended-components) for details.

<div style="position: relative; max-width: 700px; height: 350px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=basicComponent" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>

## Import

```kotlin
Expand Down
4 changes: 4 additions & 0 deletions docs/components/button.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

`Button` is a basic interactive component in Miuix, used to trigger actions or events. It provides multiple style options, including primary buttons, secondary buttons, and text buttons.

<div style="position: relative; max-width: 700px; height: 200px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=button" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>

## Import

```kotlin
Expand Down
4 changes: 4 additions & 0 deletions docs/components/card.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

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

<div style="position: relative; max-width: 700px; height: 300px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=card" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>

## Import

```kotlin
Expand Down
4 changes: 4 additions & 0 deletions docs/components/checkbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

`CheckBox` is a basic selection component in Miuix, used for toggling between checked and unchecked states. It provides an interactive selection control with animation effects, suitable for multiple selection scenarios and enabling/disabling configuration items.

<div style="position: relative; max-width: 700px; height: 100px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=checkbox" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>

## Import

```kotlin
Expand Down
4 changes: 4 additions & 0 deletions docs/components/colorpicker.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

`ColorPicker` is a color selection component in Miuix that allows users to pick colors by adjusting hue, saturation, brightness, and transparency. The component provides an intuitive slider interface with haptic feedback and real-time color preview.

<div style="position: relative; max-width: 700px; height: 260px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=colorPicker" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>

## Import

```kotlin
Expand Down
4 changes: 4 additions & 0 deletions docs/components/divider.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

`Divider` is a basic layout component in Miuix used to separate content in lists and layouts. It provides both horizontal and vertical divider styles.

<div style="position: relative; max-width: 700px; height: 160px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=divider" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>

## Import

```kotlin
Expand Down
4 changes: 4 additions & 0 deletions docs/components/floatingactionbutton.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

This component is typically used in conjunction with the `Scaffold` component to maintain consistent layout and behavior across different pages in the application.

<div style="position: relative; max-width: 700px; height: 300px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=floatingActionButton" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>

## Import

```kotlin
Expand Down
19 changes: 16 additions & 3 deletions docs/components/floatingtoolbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

This component is usually used in conjunction with `Scaffold`, placed in a specific position on the page to provide quick actions or display information.

<div style="position: relative; max-width: 700px; height: 300px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=floatingToolbar" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>

## Import

```kotlin
Expand All @@ -18,7 +22,10 @@ import top.yukonga.miuix.kmp.basic.ToolbarPosition // Used for Scaffold
Scaffold(
floatingToolbar = {
FloatingToolbar {
Row { // or Column
Row(
modifier = Modifier.padding(8.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp)
) { // or Column
IconButton(onClick = { /* Action 1 */ }) {
Icon(MiuixIcons.Useful.Edit, contentDescription = "Edit")
}
Expand Down Expand Up @@ -70,7 +77,10 @@ FloatingToolbar(
outSidePadding = PaddingValues(24.dp),
showDivider = false
) {
Row(modifier = Modifier.padding(horizontal = 8.dp)) {
Row(
modifier = Modifier.padding(8.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp)
) { // or Column
IconButton(onClick = { /* Action 1 */ }) {
Icon(MiuixIcons.Useful.Edit, contentDescription = "Edit", tint = MiuixTheme.colorScheme.onPrimaryContainer)
}
Expand All @@ -85,7 +95,10 @@ FloatingToolbar(

```kotlin
FloatingToolbar {
Column(modifier = Modifier.padding(vertical = 8.dp)) {
Column(
modifier = Modifier.padding(vertical = 8.dp),
verticalArrangement = Arrangement.spacedBy(8.dp)
) {
IconButton(onClick = { /* Action 1 */ }) {
Icon(MiuixIcons.Useful.Edit, contentDescription = "Edit")
}
Expand Down
4 changes: 4 additions & 0 deletions docs/components/icon.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

To follow night mode or theme changes, you need to actively use the `tint` property of the `Icon` component to set the icon color, commonly using `MiuixTheme.colorScheme.onBackground`.

<div style="position: relative; max-width: 700px; height: 120px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=icon" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>

## Import

```kotlin
Expand Down
4 changes: 4 additions & 0 deletions docs/components/iconbutton.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

`IconButton` is a button component in Miuix used for providing auxiliary interaction points. They are typically used in scenarios that require compact buttons, such as toolbars or image lists.

<div style="position: relative; max-width: 700px; height: 160px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=iconButton" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>

## Import

```kotlin
Expand Down
7 changes: 6 additions & 1 deletion docs/components/listpopup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

`ListPopup` is a popup list component in Miuix used to display a popup menu with multiple options. It provides a lightweight, floating temporary list suitable for various dropdown menus, context menus, and similar scenarios.

<div style="position: relative; max-width: 700px; height: 250px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=listPopup" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>

::: warning
`ListPopup` must be used within a `Scaffold` component!
:::
Expand All @@ -18,14 +22,15 @@ import top.yukonga.miuix.kmp.basic.ListPopupColumn
The ListPopup component can be used to create simple dropdown menus:

```kotlin
var showPopup = remember { mutableStateOf(false) }
val showPopup = remember { mutableStateOf(false) }
var selectedIndex by remember { mutableStateOf(0) }
val items = listOf("Option 1", "Option 2", "Option 3")

Scaffold {
Box {
TextButton(
text = "Click to show menu",
alignment = PopupPositionProvider.Align.Left,
onClick = { showPopup.value = true }
)
ListPopup(
Expand Down
4 changes: 4 additions & 0 deletions docs/components/navigationbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

These components are typically used in conjunction with the `Scaffold` component to maintain consistent layout and behavior across different pages in the application.

<div style="position: relative; max-width: 700px; height: 300px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=navigationBar" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>

## Import

```kotlin
Expand Down
4 changes: 4 additions & 0 deletions docs/components/progressindicator.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

`ProgressIndicator` is a progress indication component in Miuix used to display the progress status of operations. It provides three styles: linear progress bar, circular progress indicator, and infinite spinning indicator, suitable for different loading and progress display scenarios.

<div style="position: relative; max-width: 700px; height: 250px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=progressIndicator" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>

## Import

```kotlin
Expand Down
6 changes: 6 additions & 0 deletions docs/components/pulltorefresh.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

`PullToRefresh` is a pull-to-refresh component in Miuix that provides refresh functionality for lists and other scrollable content. It features an animated interactive refresh indicator suitable for various scenarios where data refresh is needed.

::: warning
This component is only available in touch-enabled scenes and does not work well in the Web build target!
:::

For a demonstration, see the DropDown page of the <a href="https://miuix-kotlin-multiplatform.github.io/miuix-jsCanvas/" target="_blank">Miuix Example</a>.

## Import

```kotlin
Expand Down
4 changes: 4 additions & 0 deletions docs/components/scaffold.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

`Scaffold` is a scaffolding component in Miuix used to implement basic design layout structures. It provides the fundamental framework for application interfaces, including containers for top bars, bottom bars, floating action buttons, and other elements.

<div style="position: relative; max-width: 700px; height: 350px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=scaffold" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>

::: warning
The Scaffold component provides a suitable container for cross-platform popup windows. Components such as `SuperDialog`, `SuperDropdown`, `SuperSpinner`, and `ListPopup` are all implemented based on this and therefore need to be wrapped by this component.
:::
Expand Down
4 changes: 4 additions & 0 deletions docs/components/searchbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

`SearchBar` is a component in Miuix used for user search input. It provides an intuitive and easy-to-use search interface with support for expanded/collapsed state switching and search suggestions display.

<div style="position: relative; max-width: 700px; height: 250px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=searchBar" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>

## Import

```kotlin
Expand Down
4 changes: 4 additions & 0 deletions docs/components/slider.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

`Slider` is a basic interactive component in Miuix used for selecting values within a continuous range. Users can adjust values by dragging the slider, making it suitable for scenarios such as volume adjustment, brightness control, and progress display.

<div style="position: relative; max-width: 700px; height: 150px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=slider" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>

## Import

```kotlin
Expand Down
4 changes: 4 additions & 0 deletions docs/components/smalltitle.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

`SmallTitle` is a basic title component in Miuix used to create small-sized title text. It follows Miuix's design style with preset font size, weight, and padding.

<div style="position: relative; max-width: 700px; height: 160px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=smallTitle" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>

## Import

```kotlin
Expand Down
8 changes: 6 additions & 2 deletions docs/components/superarrow.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

`SuperArrow` is a directional indicator component in Miuix, typically used for navigation or displaying additional content. It provides a title, summary, and right arrow icon with click interaction support, commonly used in settings, menu items, or list items.

<div style="position: relative; max-width: 700px; height: 280px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
Copy link

Copilot AI Jun 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This inline styling is repeated across many component docs. Extract these common styles into a shared CSS class to reduce duplication and improve maintainability.

Copilot uses AI. Check for mistakes.
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=superArrow" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>

## Import

```kotlin
Expand Down Expand Up @@ -47,7 +51,7 @@ SuperArrow(
SuperArrow supports controlling the hold-down state through the `holdDownState` parameter, typically used for visual feedback when displaying popup dialogs:

```kotlin
var showDialog = remember { mutableStateOf(false) }
val showDialog = remember { mutableStateOf(false) }

Scaffold {
SuperArrow(
Expand Down Expand Up @@ -137,7 +141,7 @@ SuperArrow(
### Using with Dialog

```kotlin
var showDialog = remember { mutableStateOf(false) }
val showDialog = remember { mutableStateOf(false) }
var language by remember { mutableStateOf("Simplified Chinese") }

Scaffold {
Expand Down
4 changes: 4 additions & 0 deletions docs/components/supercheckbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

`SuperCheckbox` is a checkbox component in Miuix that provides a title, summary, and checkbox control. It supports click interactions and is commonly used in multi-select settings and selection lists.

<div style="position: relative; max-width: 700px; height: 293px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=superCheckbox" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>

## Import

```kotlin
Expand Down
4 changes: 4 additions & 0 deletions docs/components/superdialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

`SuperDialog` is a dialog component in Miuix used to display important information, collect user input, or confirm user actions. The dialog appears above the current interface and supports custom styles and content layouts.

<div style="position: relative; max-width: 700px; height: 210px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=superDialog" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>

::: warning
`SuperDialog` must be used within a `Scaffold` component!
:::
Expand Down
4 changes: 4 additions & 0 deletions docs/components/superdropdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

`SuperDropdown` is a dropdown menu component in Miuix that provides a title, summary, and a list of dropdown options. It supports click interaction and is commonly used in option settings and list selections.

<div style="position: relative; max-width: 700px; height: 285px; border-radius: 10px; overflow: hidden; border: 1px solid #777;">
<iframe id="demoIframe" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;" src="../compose/index.html?id=superDropdown" title="Demo" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>

::: warning
`SuperDropdown` must be used within a `Scaffold` component!
:::
Expand Down
Loading
Loading