diff --git a/native/src/widget/button.rs b/native/src/widget/button.rs index c9b9df58..5d0940ec 100644 --- a/native/src/widget/button.rs +++ b/native/src/widget/button.rs @@ -33,8 +33,18 @@ use std::hash::Hash; /// Buttons can be disabled by not having an on_press. /// /// ``` +/// # use iced_native::{button, Text}; +/// # +/// # type Button<'a, Message> = +/// # iced_native::Button<'a, Message, iced_native::renderer::Null>; +/// # +/// # #[derive(Clone)] +/// # enum Message { +/// # ButtonPressed, +/// # } +/// # /// let mut state = button::State::new(); -/// let disabled_button = Button::new(&mut state, Text::new("I'm disabled!")); +/// let disabled_button = Button::::new(&mut state, Text::new("I'm disabled!")); /// ``` #[allow(missing_debug_implementations)] pub struct Button<'a, Message, Renderer: self::Renderer> { diff --git a/web/src/widget/button.rs b/web/src/widget/button.rs index 7c8612f6..6afcaee3 100644 --- a/web/src/widget/button.rs +++ b/web/src/widget/button.rs @@ -24,8 +24,14 @@ use dodrio::bumpalo; /// Buttons can be disabled by not having an on_press. /// /// ``` +/// # use iced_web::{button, Button, Text}; +/// # +/// # enum Message { +/// # ButtonPressed, +/// # } +/// # /// let mut state = button::State::new(); -/// let disabled_button = Button::new(&mut state, Text::new("I'm disabled!")); +/// let disabled_button = Button::::new(&mut state, Text::new("I'm disabled!")); /// ``` #[allow(missing_debug_implementations)]