Expand description
rect is a generic element that acts as a container for other elements.
You can specify things like width, padding or even in what direction the inner elements are stacked.
§Example
fn app() -> Element {
rsx!(
rect {
direction: "vertical",
label { "Hi!" }
label { "Hi again!"}
}
)
}Constants§
- a11y_
access_ key - a11y_
author_ id - a11y_
auto_ complete - a11y_
auto_ focus - a11y_
busy - a11y_
color_ value - a11y_
column_ count - a11y_
column_ index - a11y_
column_ index_ text - a11y_
column_ span - a11y_
current - a11y_
default_ action_ verb - a11y_
description - a11y_
disabled - a11y_
expanded - a11y_
focusable - a11y_
has_ popup - a11y_
hidden - a11y_
hovered - a11y_id
- a11y_
invalid - a11y_
is_ grammar_ error - a11y_
is_ search_ match - a11y_
is_ spelling_ error - a11y_
is_ suggestion - a11y_
keyboard_ shortcut - a11y_
language - a11y_
level - a11y_
linked - a11y_
list_ style - a11y_
live - a11y_
live_ atomic - a11y_
max_ numeric_ value - a11y_
member_ of - a11y_
min_ numeric_ value - a11y_
modal - a11y_
multiselectable - a11y_
name - a11y_
numeric_ value - a11y_
numeric_ value_ jump - a11y_
numeric_ value_ step - a11y_
orientation - a11y_
placeholder - a11y_
position_ in_ set - a11y_
read_ only - a11y_
required - a11y_
role - a11y_
role_ description - a11y_
row_ count - a11y_
row_ index - a11y_
row_ index_ text - a11y_
row_ span - a11y_
scroll_ x - a11y_
scroll_ x_ max - a11y_
scroll_ x_ min - a11y_
scroll_ y - a11y_
scroll_ y_ max - a11y_
scroll_ y_ min - a11y_
selected - a11y_
size_ of_ set - a11y_
sort_ direction - a11y_
state_ description - a11y_
toggled - a11y_
tooltip - a11y_
touch_ transparent - a11y_
url - a11y_
value - a11y_
vertical_ offset - a11y_
visited - background
- Specify a color as the background of an element.
- background_
opacity - Specify the opacity of an element’s background color.
- border
- Specify borders for an element.
- canvas_
reference - Attach a canvas reference created from the
use_canvasoruse_canvas_with_depshooks to enable drawing to an element. - color
- The
colorattribute lets you specify the color of the text. - content
- Specify how you want the automatic (e.g
width: auto) bounds in the cross axis to be constrained for the inner elements. - corner_
radius - Round the corners of an element by a specified radius.
- corner_
smoothing - Control the smoothing effect for rounded corners to create a “squircle” effect.
- cross_
align - cross_align
- decoration
- Specify the decoration in a text.
- decoration_
color - Specify the decoration’s color in a text.
- decoration_
style - Specify the decoration’s style in a text.
- direction
- Control how the inner elements stack.
- font_
family - With the
font_familyyou can specify what font you want to use for the inner text. - font_
size - You can specify the size of the text using
font_size. - font_
style - You can choose a style for a text using the
font_styleattribute. - font_
weight - You can choose a weight for text using the
font_weightattribute. - font_
width - You can choose a width for a text using the
font_widthattribute. - height
- Specify the height for the given element.
- layer
- Controls the stacking order of elements on the z-axis.
- letter_
spacing - Specify the spacing between characters of the text.
- line_
height - line_height
- main_
align - main_align
- margin
- Specify the margin of an element. You can do so by four different ways, just like in CSS.
- max_
height - Specify a maximum height for the given element.
- max_
lines - Determines the amount of lines that the text can have. It has unlimited lines by default.
- max_
width - Specify a maximum width for the given element.
- min_
height - Specify a minimum height for the given element. This can be useful if you use it alongside a percentage for the target size.
- min_
width - Specify a minimum width for the given element. This can be useful if you use it alongside a percentage for the target size.
- offset_
x - Moves the content inside of the container horizontally by the specified pixel amount. This attribute only supports pixels.
- offset_
y - Moves the content inside of the container vertically by the specified pixel amount. This attribute only supports pixels.
- opacity
- Specify the opacity for this element.
- overflow
- Specify how overflow should be handled.
- padding
- Specify the inner paddings of an element. You can do so by four different ways, just like in CSS.
- position
- Specify how you want the element to be positioned inside it’s parent area.
- position_
bottom - Specify the bottom position of an element when using
position: "absolute"orposition: "global". This supports pixels only. - position_
left - Specify the left position of an element when using
position: "absolute"orposition: "global". This supports pixels only. - position_
right - Specify the right position of an element when using
position: "absolute"orposition: "global". This supports pixels only. - position_
top - Specify the top position of an element when using
position: "absolute"orposition: "global". This supports pixels only. - reference
- Attach a reference to an element to track its layout and metadata.
- rotate
- Specify the rotation for this element.
- scale
- Specify the scale for this element.
- shadow
- Draw a shadow of the element.
- spacing
- Specify a space between the inner elements. Think it as a margin for every element but defined by its parent. It only applies to the side of the direction.
- text_
align - You can change the alignment of the text using the
text_alignattribute. - text_
height - Specify the text height behavior.
- text_
overflow - Determines how text is treated when it exceeds its
max_linescount. By default uses theclipmode, which will cut off any overflowing text, withellipsismode it will show...at the end. - text_
shadow - Specify the shadow of a text.
- visible_
height - Specify the percentage of height to be visible.
- visible_
width - Specify the percentage of width to be visible.
- width
- Specify the width for the given element.
- word_
spacing - Specify the spacing between words of the text.