# Flex

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/flex_panel/struct-flex/

**struct** · [`ferroui-controls`](/docs/0.5.0/api/ferroui-controls/) · v0.5.0

```rust
struct Flex
```

Provides attached properties for controlling the layout behavior of child
elements within a `FlexPanel`.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/flex_panel/flex.rs#L7)

## Members

- [`TYPE`](#assoc_const-type)
- [`align_self_property`](#function-align_self_property)
- [`order_property`](#function-order_property)
- [`basis_property`](#function-basis_property)
- [`shrink_property`](#function-shrink_property)
- [`grow_property`](#function-grow_property)
- [`get_align_self`](#function-get_align_self)
- [`set_align_self`](#function-set_align_self)
- [`get_order`](#function-get_order)
- [`set_order`](#function-set_order)
- [`get_basis`](#function-get_basis)
- [`set_basis`](#function-set_basis)
- [`get_shrink`](#function-get_shrink)
- [`set_shrink`](#function-set_shrink)
- [`get_grow`](#function-get_grow)
- [`set_grow`](#function-set_grow)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this type.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/flex_panel/flex.rs#L9)

<a id="function-align_self_property"></a>

### align_self_property

```rust
fn align_self_property() -> &'static AttachedProperty<Option<FlexAlignItems>>
```

Defines an attached property to control the cross-axis alignment
of a specific child in a flex layout.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/flex_panel/flex.rs#L11)

<a id="function-order_property"></a>

### order_property

```rust
fn order_property() -> &'static AttachedProperty<i32>
```

Defines an attached property to control the order of a specific
child in a flex layout.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/flex_panel/flex.rs#L11)

<a id="function-basis_property"></a>

### basis_property

```rust
fn basis_property() -> &'static AttachedProperty<FlexBasis>
```

Defines an attached property to control the initial main-axis
size of a specific child in a flex layout.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/flex_panel/flex.rs#L11)

<a id="function-shrink_property"></a>

### shrink_property

```rust
fn shrink_property() -> &'static AttachedProperty<f64>
```

Defines an attached property to control the factor by which a
specific child can shrink along the main-axis in a flex layout.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/flex_panel/flex.rs#L11)

<a id="function-grow_property"></a>

### grow_property

```rust
fn grow_property() -> &'static AttachedProperty<f64>
```

Defines an attached property to control the factor by which a
specific child can grow along the main-axis in a flex layout.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/flex_panel/flex.rs#L11)

<a id="function-get_align_self"></a>

### get_align_self

```rust
fn get_align_self(layoutable: &Layoutable) -> Option<FlexAlignItems>
```

Gets the cross-axis alignment override for a child item in a
`FlexPanel`.

This property is used to override the `AlignItems` property of the
panel for a specific child. When omitted, `AlignItems` is not
overridden. Equivalent to the CSS align-self property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/flex_panel/flex.rs#L68)

<a id="function-set_align_self"></a>

### set_align_self

```rust
fn set_align_self(layoutable: &Layoutable, value: Option<FlexAlignItems>)
```

Sets the cross-axis alignment override for a child item in a
`FlexPanel`.

This property is used to override the `AlignItems` property of the
panel for a specific child. When omitted, `AlignItems` is not
overridden. Equivalent to the CSS align-self property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/flex_panel/flex.rs#L78)

<a id="function-get_order"></a>

### get_order

```rust
fn get_order(layoutable: &Layoutable) -> i32
```

Retrieves the order in which a child item appears within the
`FlexPanel`.

A lower order value means the item will be positioned earlier within
the container. Items with the same order value are laid out in their
source document order. When omitted, it is set to 0. Equivalent to the
CSS order property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/flex_panel/flex.rs#L89)

<a id="function-set_order"></a>

### set_order

```rust
fn set_order(layoutable: &Layoutable, value: i32)
```

Sets the order in which a child item appears within the `FlexPanel`.

A lower order value means the item will be positioned earlier within
the container. Items with the same order value are laid out in their
source document order. When omitted, it is set to 0. Equivalent to the
CSS order property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/flex_panel/flex.rs#L99)

<a id="function-get_basis"></a>

### get_basis

```rust
fn get_basis(layoutable: &Layoutable) -> FlexBasis
```

Gets the initial size along the main-axis of an item in a
`FlexPanel`, before free space is distributed according to the flex
factors.

Either automatic size, a fixed length, or a percentage of the
container's size. When omitted, it is set to `FlexBasis::AUTO`.
Equivalent to the CSS flex-basis property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/flex_panel/flex.rs#L110)

<a id="function-set_basis"></a>

### set_basis

```rust
fn set_basis(layoutable: &Layoutable, value: FlexBasis)
```

Sets the initial size along the main-axis of an item in a
`FlexPanel`, before free space is distributed according to the flex
factors.

Either automatic size, a fixed length, or a percentage of the
container's size. When omitted, it is set to `FlexBasis::AUTO`.
Equivalent to the CSS flex-basis property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/flex_panel/flex.rs#L121)

<a id="function-get_shrink"></a>

### get_shrink

```rust
fn get_shrink(layoutable: &Layoutable) -> f64
```

Gets the factor by which an item can shrink along the main-axis,
relative to other items in a `FlexPanel`.

When omitted, it is set to 1. Equivalent to the CSS flex-shrink
property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/flex_panel/flex.rs#L130)

<a id="function-set_shrink"></a>

### set_shrink

```rust
fn set_shrink(layoutable: &Layoutable, value: f64)
```

Sets the factor by which an item can shrink along the main-axis,
relative to other items in a `FlexPanel`.

When omitted, it is set to 1. Equivalent to the CSS flex-shrink
property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/flex_panel/flex.rs#L139)

<a id="function-get_grow"></a>

### get_grow

```rust
fn get_grow(layoutable: &Layoutable) -> f64
```

Gets the factor by which an item can grow along the main-axis,
relative to other items in a `FlexPanel`.

When omitted, it is set to 0. Equivalent to the CSS flex-grow
property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/flex_panel/flex.rs#L148)

<a id="function-set_grow"></a>

### set_grow

```rust
fn set_grow(layoutable: &Layoutable, value: f64)
```

Sets the factor by which an item can grow along the main-axis,
relative to other items in a `FlexPanel`.

When omitted, it is set to 0. Equivalent to the CSS flex-grow
property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/flex_panel/flex.rs#L157)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
