Module freya_elements::paragraph
source · Expand description
paragraph
element let’s you build texts with different styles.
This used used with the text
element.
fn app() -> Element {
rsx!(
paragraph {
text {
font_size: "15",
"Hello, "
}
text {
font_size: "30",
"World!"
}
}
)
}
Constants§
- The
color
attribute 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 the
font_family
you can specify what font you want to use for the inner text. - You can specify the size of the text using
font_size
. - You can choose a style for a text using the
font_style
attribute. - You can choose a weight for text using the
font_weight
attribute. - You can choose a width for a text using the
font_width
attribute. - Specify the width and height 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.
- max_width & max_height
- Determines the amount of lines that the text can have. It has unlimited lines by default.
- min_width & min_height
- Specify the opacity of an element and all its descendants.
- Specify how you want the element to be positioned inside it’s parent area.
- The
rotate
attribute let’s you rotate an element. - You can change the alignment of the text using the
text_align
attribute. - Specify the text height behavior.
- Determines how text is treated when it exceeds its
max_lines
count. By default uses theclip
mode, which will cut off any overflowing text, withellipsis
mode it will show...
at the end. - Specify the shadow of a text.
- Specify the spacing between words of the text.