# FlexPanel

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

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

```rust
struct FlexPanel
```

A panel that arranges child controls using CSS FlexBox principles.
It organizes child items in one or more lines along a main-axis (either
row or column) and provides advanced control over their sizing and
layout.

See the CSS FlexBox specification: <https://www.w3.org/TR/css-flexbox-1>

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`direction_property`](#function-direction_property)
- [`justify_content_property`](#function-justify_content_property)
- [`align_items_property`](#function-align_items_property)
- [`align_content_property`](#function-align_content_property)
- [`wrap_property`](#function-wrap_property)
- [`column_spacing_property`](#function-column_spacing_property)
- [`row_spacing_property`](#function-row_spacing_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`direction`](#function-direction)
- [`set_direction`](#function-set_direction)
- [`justify_content`](#function-justify_content)
- [`set_justify_content`](#function-set_justify_content)
- [`align_items`](#function-align_items)
- [`set_align_items`](#function-set_align_items)
- [`align_content`](#function-align_content)
- [`set_align_content`](#function-set_align_content)
- [`wrap`](#function-wrap)
- [`set_wrap`](#function-set_wrap)
- [`column_spacing`](#function-column_spacing)
- [`set_column_spacing`](#function-set_column_spacing)
- [`row_spacing`](#function-row_spacing)
- [`set_row_spacing`](#function-set_row_spacing)

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

### TYPE

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

The runtime type of this class.

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

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

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<FlexPanel>
```

Returns a strong reference to this object.

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

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

### direction_property

```rust
fn direction_property() -> &'static StyledProperty<FlexDirection>
```

Defines the `Direction` property.

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

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

### justify_content_property

```rust
fn justify_content_property() -> &'static StyledProperty<FlexJustifyContent>
```

Defines the `JustifyContent` property.

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

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

### align_items_property

```rust
fn align_items_property() -> &'static StyledProperty<FlexAlignItems>
```

Defines the `AlignItems` property.

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

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

### align_content_property

```rust
fn align_content_property() -> &'static StyledProperty<FlexAlignContent>
```

Defines the `AlignContent` property.

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

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

### wrap_property

```rust
fn wrap_property() -> &'static StyledProperty<FlexWrap>
```

Defines the `Wrap` property.

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

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

### column_spacing_property

```rust
fn column_spacing_property() -> &'static StyledProperty<f64>
```

Defines the `ColumnSpacing` property.

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

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

### row_spacing_property

```rust
fn row_spacing_property() -> &'static StyledProperty<f64>
```

Defines the `RowSpacing` property.

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

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

### construct

```rust
fn construct() -> Self
```

Creates the class data; see `ferroui_base::FerroObject::construct`.

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

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

### new

```rust
fn new() -> Ref<Self>
```



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

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

### direction

```rust
fn direction(self: &Self) -> FlexDirection
```

The direction of the panel's main-axis, determining the orientation
in which child controls are laid out.

The default value is `FlexDirection::Row`. Equivalent to the CSS
flex-direction property.

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

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

### set_direction

```rust
fn set_direction(self: &Self, value: FlexDirection)
```



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

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

### justify_content

```rust
fn justify_content(self: &Self) -> FlexJustifyContent
```

The main-axis alignment of child items inside a line of the panel.
Typically used to distribute extra free space leftover after flexible
lengths and margins have been resolved.

The default value is `FlexJustifyContent::FlexStart`. Equivalent to
the CSS justify-content property.

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

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

### set_justify_content

```rust
fn set_justify_content(self: &Self, value: FlexJustifyContent)
```



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

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

### align_items

```rust
fn align_items(self: &Self) -> FlexAlignItems
```

The cross-axis alignment of all child items inside a line of the
panel. Similar to `justify_content`, but in the perpendicular
direction.

The default value is `FlexAlignItems::Stretch`. Equivalent to the
CSS align-items property.

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

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

### set_align_items

```rust
fn set_align_items(self: &Self, value: FlexAlignItems)
```



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

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

### align_content

```rust
fn align_content(self: &Self) -> FlexAlignContent
```

The cross-axis alignment of lines in the panel when there is extra
space. Similar to `align_items`, but for entire lines. The `wrap`
property set to `FlexWrap::Wrap` mode allows controls to be
arranged on multiple lines.

The default value is `FlexAlignContent::Stretch`. Equivalent to the
CSS align-content property.

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

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

### set_align_content

```rust
fn set_align_content(self: &Self, value: FlexAlignContent)
```



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

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

### wrap

```rust
fn wrap(self: &Self) -> FlexWrap
```

The wrap mode, controlling whether the panel is single-line or
multi-line. Additionally, it determines the cross-axis stacking
direction for new lines.

The default value is `FlexWrap::NoWrap`. Equivalent to the CSS
flex-wrap property.

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

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

### set_wrap

```rust
fn set_wrap(self: &Self, value: FlexWrap)
```



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

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

### column_spacing

```rust
fn column_spacing(self: &Self) -> f64
```

The minimum horizontal spacing between child items or lines,
depending on the main-axis direction of the panel.

The default value is 0. Similar to the CSS column-gap property.

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

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

### set_column_spacing

```rust
fn set_column_spacing(self: &Self, value: f64)
```



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

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

### row_spacing

```rust
fn row_spacing(self: &Self) -> f64
```

The minimum vertical spacing between child items or lines, depending
on the main-axis direction of the panel.

The default value is 0. Similar to the CSS row-gap property.

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

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

### set_row_spacing

```rust
fn set_row_spacing(self: &Self, value: f64)
```



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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- [`PanelImplExt`](/docs/0.5.0/api/ferroui-controls/trait-panelimplext/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`InputElementImplExt`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimplext/)
- [`InteractiveImplExt`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimplext/)
- [`LayoutableImplExt`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- [`VisualImplExt`](/docs/0.5.0/api/ferroui-base/trait-visualimplext/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<FlexPanel>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`InteractiveImpl`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`ControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-controlimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`PanelImpl`](/docs/0.5.0/api/ferroui-controls/trait-panelimpl/)

## Availability

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