StylishCommandPalette

fun StylishCommandPalette(expanded: Boolean, onDismiss: () -> Unit, query: String, onQueryChange: (String) -> Unit, modifier: Modifier = Modifier, items: List<StylishCommandItem>, placeholder: String = "コマンドを入力…", maxResults: Int = 8, shape: Shape = RoundedCornerShape(DefaultStylishDimensions.connectedCornerRadius), containerColor: Color = MaterialTheme.colorScheme.surfaceContainerHigh, contentColor: Color = MaterialTheme.colorScheme.onSurface, width: Dp = 480.dp)

A searchable command palette — the web "Command/⌘K" pattern from shadcn/ui (cmdk) and Radix UI.

Shows a centered modal with a query input and the filtered command list. Items are filtered against StylishCommandItem.label and StylishCommandItem.keywords. The list supports keyboard navigation: Arrow Up/Down moves the selection, Enter selects, Escape dismisses.

Parameters

expanded

Whether the palette is visible.

onDismiss

Called when the palette should close (Escape, click outside, or item selection).

query

The current query text.

onQueryChange

Called as the user types.

modifier

Modifier applied to the palette surface.

items

The commands to search.

placeholder

Placeholder text of the query input. Defaults to "コマンドを入力…".

maxResults

Maximum number of filtered results shown. Defaults to 8.

shape

Corner shape of the palette. Defaults to RoundedCornerShape with DefaultStylishDimensions.connectedCornerRadius.

containerColor

Background of the palette. Defaults to MaterialTheme.colorScheme.surfaceContainerHigh.

contentColor

Foreground color of the palette.

width

Width of the palette. Defaults to 480 dp.