Package-level declarations

Types

Link copied to clipboard
data class AnimatedVisibilityState(val visible: Boolean, val alpha: Float)

Holds the animated visibility state for a component, including the current visibility boolean and an animated alpha value.

Link copied to clipboard
data class ConnectedCorners(val topStart: Boolean = false, val topEnd: Boolean = false, val bottomStart: Boolean = false, val bottomEnd: Boolean = false)

Describes which corners of a Connected UI item are outer corners (large radius) versus inner/joined corners (small radius).

Link copied to clipboard
data class ConnectedEdges(val top: Boolean, val end: Boolean, val bottom: Boolean, val start: Boolean)

Describes which edges of a Connected UI item should have an outline border drawn.

Link copied to clipboard

Stable identifier namespace used by Stylish UI's component roots.

Link copied to clipboard
data class StylishInteractionPolicy(val minimumTarget: Dp = DefaultStylishDimensions.iconButtonMinSize, val focusRingWidth: Dp = DefaultStylishDimensions.focusRingWidth, val pressedScale: Float = DefaultStylishAnimationTokens.pressedScale, val stateLayerEnabled: Boolean = true, val focusRingEnabled: Boolean = true, val pressScaleEnabled: Boolean = true)

The cross-component interaction contract used by Stylish UI.

Link copied to clipboard
data class StylishWindowBreakpoints(val compactWidthMax: Dp = 600.dp, val mediumWidthMax: Dp = 840.dp, val compactHeightMax: Dp = 480.dp, val mediumHeightMax: Dp = 900.dp)

Customizable width and height boundaries for applications with unusual layouts.

Link copied to clipboard

Height buckets used when vertical space changes the layout strategy.

Link copied to clipboard

Platform-independent window classification derived from available content space.

Link copied to clipboard

Width buckets shared by phone, tablet, desktop, and web layouts.

Link copied to clipboard

Describes the visibility behavior of a UI element that can be shown or hidden based on scroll position or other conditions.

Properties

Link copied to clipboard

The default interaction contract for all Stylish components.

Link copied to clipboard

Composition local that forces the reduced-motion mode for isStylishReducedMotionEnabled, regardless of the platform setting.

Functions

Link copied to clipboard

Classifies the available size using the Material adaptive breakpoints.

Classifies a window using caller-provided breakpoints.

Link copied to clipboard

Computes the outer corners for the item at index in a vertical (column) Connected UI list.

Link copied to clipboard

Returns the outline edges for the item at index in a vertical (column) Connected UI list.

Link copied to clipboard
fun connectedGridCorners(index: Int, size: Int, columns: Int): ConnectedCorners

Computes the outer corners for the item at index in a grid-based Connected UI layout.

Link copied to clipboard
fun connectedGridEdges(index: Int, size: Int, columns: Int): ConnectedEdges

Returns the outline edges for the item at index in a grid-based Connected UI layout.

Link copied to clipboard
fun connectedGridItemShape(index: Int, totalItems: Int, columns: Int, outerCornerRadius: Dp = DefaultStylishDimensions.connectedCornerRadius, joinedCornerRadius: Dp = DefaultStylishDimensions.joinedCornerRadius): Shape

Builds a position-aware RoundedCornerShape for the item at index in a grid-based Connected UI layout.

Link copied to clipboard
fun Modifier.connectedOutline(edges: ConnectedEdges, corners: ConnectedCorners, cornerRadius: Dp = StylishTheme.dimensions.connectedCornerRadius): Modifier

Draws a hairline outline around a Connected UI item, respecting its edges and corners.

Link copied to clipboard

Computes the outer corners for the item at index in a horizontal (row) Connected UI list.

Link copied to clipboard

Returns the outline edges for the item at index in a horizontal (row) Connected UI list.

Link copied to clipboard
fun connectedShape(corners: ConnectedCorners, cornerRadius: Dp = DefaultStylishDimensions.connectedCornerRadius, joinedCornerRadius: Dp = DefaultStylishDimensions.joinedCornerRadius): Shape

Builds a RoundedCornerShape for a Connected UI item based on its corners configuration.

Link copied to clipboard
fun isActionable(enabled: Boolean = true, hasClickAction: Boolean, hasLongClickAction: Boolean = false): Boolean

Determines whether a component should behave as an interactive (actionable) element.

Link copied to clipboard

Returns whether the current platform requests reduced motion.

Link copied to clipboard

Returns the current visibility state as a boolean, observing any reactive sources (such as VisibilityState.ScrollAware.scrollState) as needed.

Link copied to clipboard

Creates a VisibilityState.NestedScrollAware for a nested-scrolling container.

Link copied to clipboard

Remembers one focus requester per item in a keyboard-navigable collection.

Link copied to clipboard

Hoists an interaction source without forcing every component to repeat the nullable-source boilerplate. Passing a source keeps interaction state observable by the caller and tests.

Link copied to clipboard

Computes the animated visibility state for a given VisibilityState, providing both the current visibility boolean and an animated alpha value.

Link copied to clipboard
fun StylishAdaptiveLayout(compact: @Composable (StylishWindowSizeClass) -> Unit, modifier: Modifier = Modifier, medium: @Composable (StylishWindowSizeClass) -> Unit = compact, expanded: @Composable (StylishWindowSizeClass) -> Unit = medium)

Selects content from the space actually offered by the parent, without platform APIs. The medium and expanded slots default down to the next smaller layout.

Link copied to clipboard
fun stylishContrastRatio(first: Color, second: Color): Double

Returns the WCAG 2.2 contrast ratio between two colors, from 1 to 21.

Link copied to clipboard
fun Modifier.stylishFocusRing(interactionSource: InteractionSource, shape: Shape = RectangleShape, color: Color = MaterialTheme.colorScheme.primary, width: Dp = 2.dp): Modifier

Draws a focus indicator ring around this component while the interactionSource reports a focus interaction.

Link copied to clipboard
fun stylishInteractiveElevation(interactionSource: InteractionSource, actionable: Boolean): Dp

Resolves the shared elevation ladder for an actionable surface.

Link copied to clipboard
fun Modifier.stylishInteractiveSurface(interactionSource: InteractionSource, shape: Shape = RectangleShape, policy: StylishInteractionPolicy = DefaultStylishInteractionPolicy): Modifier

Applies the common interaction contract to a custom surface.

Link copied to clipboard

Applies the platform minimum touch target to an interactive Stylish element.

Applies a caller-selected minimum target while retaining Material 3's local minimum-target semantics. The explicit size constraint makes custom components obey the same contract even when a host application changes LocalMinimumInteractiveComponentEnforcement.

Link copied to clipboard
fun stylishMeetsWcagAa(first: Color, second: Color): Boolean

Whether normal text meets WCAG AA (4.5:1).

Link copied to clipboard
fun Modifier.stylishPressScale(interactionSource: InteractionSource, pressedScale: Float? = null): Modifier

Adds a restrained press-scale response to an interactive surface.

Link copied to clipboard
fun Modifier.stylishRovingFocus(requester: FocusRequester, index: Int, itemCount: Int, onMove: (Int) -> Unit, onActivate: () -> Unit? = null, onEscape: () -> Unit? = null): Modifier

Adds roving focus behavior to a collection item. Arrow/Home/End keys are handled and the callback receives the target index; the caller owns the requesters so focus remains hoisted.

Link copied to clipboard
fun Modifier.stylishStateLayer(interactionSource: InteractionSource, shape: Shape = RectangleShape): Modifier

Draws the Material 3 state-layer overlay on top of this component's content.

Link copied to clipboard

Adds Stylish UI's stable component identifier to a root node.