zng/label.rs
1#![cfg(feature = "text_input")]
2
3//! Label widget and properties.
4//!
5//! The [`Label!`](struct@Label) widget is a text presenter that represents a label.
6//!
7//! An optional `target` widget can be set, the target is focused when the label is clocked.
8//!
9//! Labels also integrate with the mnemonic shortcuts and will automatically hide mnemonic markers from text if a parent widget
10//! is [`mnemonic`]. Labels can also underline the mnemonic character when active if [`mnemonic_underline`] is set on the widget or context.
11//!
12//! [`mnemonic`]: fn@zng::gesture::mnemonic
13//! [`mnemonic_underline`]: fn@zng::label::mnemonic_underline
14//!
15//! ```
16//! use zng::prelude::*;
17//! # fn example() {
18//!
19//! # let _ =
20//! Container! {
21//! child_start = zng::label::Label!("Name", "name-field");
22//! child_spacing = 5;
23//! child = TextInput! {
24//! id = "name-field";
25//! txt = var_from("");
26//! };
27//! }
28//! # ; }
29//! ```
30//!
31//! # Full API
32//!
33//! See [`zng_wgt_text_input::label`] for the full widget API.
34
35pub use zng_wgt_text_input::label::{DefaultStyle, Label, mnemonic_underline, style_fn};
36// TODO(breaking) Label! in prelude