Skip to content

Bind Button & IconButton variants: Outlined/Text/Elevated/FilledTonal + IconToggleButton family #55

@jonathanpeppers

Description

@jonathanpeppers

Today the facade ships only the base filled Button and base IconButton. The full Material 3 button family has six fill styles each, plus toggle variants for icon buttons, and none of the rest are wrapped. Most apps need at least OutlinedButton and TextButton to build a normal dialog/form.

Missing composables

Composable Kt class
OutlinedButton ButtonKt
TextButton ButtonKt
ElevatedButton ButtonKt
FilledTonalButton ButtonKt
FilledIconButton IconButtonKt
FilledTonalIconButton IconButtonKt
OutlinedIconButton IconButtonKt
IconToggleButton IconButtonKt
FilledIconToggleButton IconButtonKt
FilledTonalIconToggleButton IconButtonKt
OutlinedIconToggleButton IconButtonKt

Approach

Same shape as the existing Button and IconButton:

  1. Check whether the generated binding exposes the method — if so, call it directly (preferred). Most non-Color/Dp-only overloads should survive the binder.
  2. For stripped overloads (any signature with Color/Dp/TextUnit inline-class params, hash-mangled *-(...)): add a [ComposeBridge] partial in ComposeBridges.cs + [ComposeDefaults] in ComposeDefaults.cs.
  3. One .cs file per type in src/ComposeNet.Compose/ (e.g. OutlinedButton.cs), deriving from ComposableContainer.
  4. Toggle variants take a MutableState<bool> (or a bool checked + Action<bool> onCheckedChange) — mirror the existing Checkbox / Switch shape.

Sample

Drop one of each into the sample's existing button section so we can visually confirm the five button fill styles render correctly under MaterialTheme.

Tracking

Long-term, dotnet/java-interop#1440 will let us delete the bridges and call the generated bindings directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions