OutlineButton

Functions summary

Unit
@Composable
OutlineButton(
    text: String,
    contentColor: ColorProvider,
    onClick: Action,
    modifier: GlanceModifier,
    enabled: Boolean,
    icon: ImageProvider?,
    maxLines: Int
)

An outline button styled per Material3.

Unit
@Composable
OutlineButton(
    text: String,
    contentColor: ColorProvider,
    onClick: () -> Unit,
    modifier: GlanceModifier,
    enabled: Boolean,
    icon: ImageProvider?,
    maxLines: Int,
    key: String?
)

An outline button styled per Material3.

Functions

OutlineButton

@Composable
fun OutlineButton(
    text: String,
    contentColor: ColorProvider,
    onClick: Action,
    modifier: GlanceModifier = GlanceModifier,
    enabled: Boolean = true,
    icon: ImageProvider? = null,
    maxLines: Int = Int.MAX_VALUE
): Unit

An outline button styled per Material3. It has a transparent background. It is more opinionated than Button and suitable for uses where M3 is preferred.

Parameters
text: String

The text that this button will show.

contentColor: ColorProvider

The color used for the text, optional icon tint, and outline.

onClick: Action

The action to be performed when this button is clicked.

modifier: GlanceModifier = GlanceModifier

The modifier to be applied to this button.

enabled: Boolean = true

If false, the button will not be clickable.

icon: ImageProvider? = null

An optional leading icon placed before the text.

maxLines: Int = Int.MAX_VALUE

An optional maximum number of lines for the text to span, wrapping if necessary. If the text exceeds the given number of lines, it will be truncated.

OutlineButton

@Composable
fun OutlineButton(
    text: String,
    contentColor: ColorProvider,
    onClick: () -> Unit,
    modifier: GlanceModifier = GlanceModifier,
    enabled: Boolean = true,
    icon: ImageProvider? = null,
    maxLines: Int = Int.MAX_VALUE,
    key: String? = null
): Unit

An outline button styled per Material3. It has a transparent background. It is more opinionated than Button and suitable for uses where M3 is preferred.

Parameters
text: String

The text that this button will show.

contentColor: ColorProvider

The color used for the text, optional icon tint, and outline.

onClick: () -> Unit

The action to be performed when this button is clicked.

modifier: GlanceModifier = GlanceModifier

The modifier to be applied to this button.

enabled: Boolean = true

If false, the button will not be clickable.

icon: ImageProvider? = null

An optional leading icon placed before the text.

maxLines: Int = Int.MAX_VALUE

An optional maximum number of lines for the text to span, wrapping if necessary. If the text exceeds the given number of lines, it will be truncated.

key: String? = null

A stable and unique key that identifies the action for this button. This ensures that the correct action is triggered, especially in cases of items that change order. If not provided we use the key that is automatically generated by the Compose runtime, which is unique for every exact code location in the composition tree.