azul_widgets/label.rs
1use azul_core::{
2 dom::{Dom, DomString},
3};
4
5#[derive(Debug, Clone, Hash, PartialEq, Eq)]
6pub struct Label {
7 pub text: DomString,
8}
9
10impl Label {
11
12 #[inline]
13 pub fn new<S: Into<DomString>>(text: S) -> Self {
14 Self { text: text.into() }
15 }
16
17 #[inline]
18 pub fn dom(self) -> Dom {
19 Dom::label(self.text).with_class("__azul-native-label")
20 }
21}