summaryrefslogtreecommitdiffstats
path: root/widget/src/row.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-09-19 06:49:22 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-09-19 06:49:22 +0200
commit31c42c1d02d6a76dedaa780e6832a23765c8aef2 (patch)
tree2dbb170bbf4743746600d89b08f8dd288175022d /widget/src/row.rs
parentcda1369c790cac27dce90abaead2bca940047ed0 (diff)
downloadiced-31c42c1d02d6a76dedaa780e6832a23765c8aef2.tar.gz
iced-31c42c1d02d6a76dedaa780e6832a23765c8aef2.tar.bz2
iced-31c42c1d02d6a76dedaa780e6832a23765c8aef2.zip
Write doc examples for `column` and `row`
Diffstat (limited to 'widget/src/row.rs')
-rw-r--r--widget/src/row.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/widget/src/row.rs b/widget/src/row.rs
index 85af912f..fbb3f066 100644
--- a/widget/src/row.rs
+++ b/widget/src/row.rs
@@ -12,6 +12,27 @@ use crate::core::{
};
/// A container that distributes its contents horizontally.
+///
+/// # Example
+/// ```no_run
+/// # mod iced { pub mod widget { pub use iced_widget::*; } }
+/// # pub type State = ();
+/// # pub type Element<'a, Message> = iced_widget::core::Element<'a, Message, iced_widget::Theme, iced_widget::Renderer>;
+/// use iced::widget::{button, row};
+///
+/// #[derive(Debug, Clone)]
+/// enum Message {
+/// // ...
+/// }
+///
+/// fn view(state: &State) -> Element<'_, Message> {
+/// row![
+/// "I am to the left!",
+/// button("I am in the middle!"),
+/// "I am to the right!",
+/// ].into()
+/// }
+/// ```
#[allow(missing_debug_implementations)]
pub struct Row<'a, Message, Theme = crate::Theme, Renderer = crate::Renderer> {
spacing: f32,