View
A general-purpose retained container for layout, paint, pointer input, and accessibility.
Loading interactive demo…
div()
.p(20.0)
.gap(12.0)
.child(text("Hello from Rust"))
.child(button().on_click(continue_clicked).child("Continue"))#Import
Import div from quickgui.
use quickgui::*;#Usage
div()
.p(20.0)
.gap(12.0)
.child(text("Hello from Rust"))
.child(button().on_click(continue_clicked).child("Continue"))#API reference
Expand an entry for its description and complete signature. A dash means no declaration default is documented.
div
View sourcepub fn div() -> ElementCreate a container element.
bgpub fn bg(mut self, color: Color) -> Self—
pxpub fn px(mut self, value: f32) -> Self—
hoverpub fn hover(mut self, style: impl FnOnce(ElementStateStyle) -> ElementStateStyle) -> Self—
Configures hover for this part.
pub fn hover(mut self, style: impl FnOnce(ElementStateStyle) -> ElementStateStyle) -> SelfView sourcechildpub fn child(mut self, child: impl IntoElement) -> Self—
on_clickpub fn on_click<V>(mut self, listener: crate::ClickListener<V>) -> Self—
Attach a listener registered by [`crate::ViewContext::listener`].
pub fn on_click<V>(mut self, listener: crate::ClickListener<V>) -> SelfView source