Skip to content

Commit

Permalink
Fix doctest for zstack
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorstrate committed Nov 22, 2024
1 parent 2306b98 commit 724d168
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions xilem/src/view/zstack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@ use masonry::{
///
/// # Example
///
/// This example shows how to add a text label on top of an image.
/// This example shows how to add two text labels on top of each other.
///
/// ```
/// zstack((
/// image(some_image),
/// label("Overlay text")
/// ))
/// use xilem::WidgetView;
/// use xilem::view::{zstack, label};
///
/// fn view() -> impl WidgetView<()> {
/// zstack::<(), (), _>((
/// label("Background"),
/// label("Foreground")
/// ))
/// }
/// ```
pub fn zstack<State, Action, Seq: ZStackSequence<State, Action>>(sequence: Seq) -> ZStack<Seq> {
ZStack {
Expand Down

0 comments on commit 724d168

Please sign in to comment.