Skip to content

Commit

Permalink
[#674] Update snackbars documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
paulinea committed Oct 23, 2023
1 parent c699480 commit 41d08a7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/components/Snackbars.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ action that was just taken, or retrying an action that had failed.
* [Accessibility](#accessibility)
* [Implementation](#implementation)
* [Jetpack Compose](#jetpack-compose)
* [OdsSnackbarHost API](#odssnackbarhost-api)

---

Expand Down Expand Up @@ -61,7 +62,9 @@ Scaffold(
scaffoldState = scaffoldState,
snackbarHost = {
OdsSnackbarHost(hostState = it) { data ->
OdsSnackbar(snackbarData = data)
OdsSnackbar(data = data, actionOnNewLine = true, onActionClick = {
doSomething()
})
}
}) {
OdsButton(
Expand All @@ -80,3 +83,12 @@ Scaffold(
)
}
```

#### OdsSnackbarHost API

Parameter | Default value | Description
-- | -- | --
`hostState: SnackbarHostState` | | State of this component to read and show `OdsSnackbar` accordingly.
`modifier: Modifier` | `Modifier` | `Modifier` applied to the snackbar host
`snackbar: (SnackbarData) -> OdsSnackbar` | `{ OdsSnackbar(it) }` | Instance of the `OdsSnackbar` to be shown at the appropriate time with appearance based on the `SnackbarData` provided as a param
{:.table}

0 comments on commit 41d08a7

Please sign in to comment.