Write docs for iced_web

This commit is contained in:
Héctor Ramón Jiménez 2019-11-22 22:14:04 +01:00
parent 048909b45d
commit fa227255b0
10 changed files with 225 additions and 17 deletions

View file

@ -1,15 +1,31 @@
//! Use the built-in widgets or create your own.
//!
//! # Custom widgets
//! If you want to implement a custom widget, you simply need to implement the
//! [`Widget`] trait. You can use the API of the built-in widgets as a guide or
//! source of inspiration.
//!
//! # Re-exports
//! For convenience, the contents of this module are available at the root
//! module. Therefore, you can directly type:
//!
//! ```
//! use iced_web::{button, Button, Widget};
//! ```
//!
//! [`Widget`]: trait.Widget.html
use crate::Bus;
use dodrio::bumpalo;
pub mod button;
pub mod slider;
pub mod text;
mod checkbox;
mod column;
mod image;
mod radio;
mod row;
mod text;
#[doc(no_inline)]
pub use button::Button;
@ -26,7 +42,16 @@ pub use image::Image;
pub use radio::Radio;
pub use row::Row;
/// A component that displays information and allows interaction.
///
/// If you want to build your own widgets, you will need to implement this
/// trait.
///
/// [`Widget`]: trait.Widget.html
pub trait Widget<Message> {
/// Produces a VDOM node for the [`Widget`].
///
/// [`Widget`]: trait.Widget.html
fn node<'b>(
&self,
bump: &'b bumpalo::Bump,