Expand description
label simply let’s you display some text.
§Example
fn app() -> Element {
    rsx!(
        label {
            "Hello World"
        }
    )
}Constants§
- Thecolorattribute lets you specify the color of the text.
- Specify the decoration in a text.
- Specify the decoration’s color in a text.
- Specify the decoration’s style in a text.
- With thefont_familyyou can specify what font you want to use for the inner text.
- You can specify the size of the text usingfont_size.
- You can choose a style for a text using thefont_styleattribute.
- You can choose a weight for text using thefont_weightattribute.
- You can choose a width for a text using thefont_widthattribute.
- Specify the width for the given element.
- Specify the spacing between characters of the text.
- line_height
- main_align & cross_align
- Specify the margin of an element. You can do so by four different ways, just like in CSS.
- Specify a maximum height for the given element.
- Determines the amount of lines that the text can have. It has unlimited lines by default.
- Specify a maximum width for the given element.
- This can be useful if you use it alongside a percentage for the target size.
- Specify a minimum height for the given element. This can be useful if you use it alongside a percentage for the target size.
- Specify how you want the element to be positioned inside it’s parent area.
- You can change the alignment of the text using thetext_alignattribute.
- Specify the text height behavior.
- Determines how text is treated when it exceeds itsmax_linescount. By default uses theclipmode, which will cut off any overflowing text, withellipsismode it will show...at the end.
- Specify the shadow of a text.
- Specify the height for the given element.
- Specify the spacing between words of the text.