use fission::prelude::*;
use fission::op::AlignItems;
fission_component! {
pub ConnectionSummary<()> {
props { connected: bool }
}
view(connection, _state, cx) {
let spacing = &cx.view.env().theme.tokens.spacing;
} =>
Row(
gap: spacing.s,
align_items: AlignItems::Center,
children: [
Text(cx.tr("connection.status")),
Text(cx.tr(if connection.connected {
"connection.connected"
} else {
"connection.disconnected"
})),
],
)
}
Field | Type | Meaning | Notes / default behavior |
|---|---|---|---|
id | Option<WidgetId> | Stable widget identity. | Defaults to None. |
children | Vec<Widget> | Child widgets laid out from left to right. | Defaults to an empty list. |
semantics | Option<Semantics> | Optional accessibility semantics wrapper. | When present, the lowered row is wrapped in a semantics node. |
flex_grow | f32 | How much extra space the row absorbs from its parent. | Defaults to 0.0. |
flex_shrink | f32 | How much the row may shrink when space is tight. | Defaults to 1.0. |
gap | Option<f32> | Horizontal spacing between children. | Defaults to None. |
wrap | FlexWrap | Whether children wrap onto another line. | Defaults to FlexWrap::NoWrap. |
align_items | AlignItems | Cross-axis alignment, which is vertical in a row. | Defaults to AlignItems::Center. |
justify_content | JustifyContent | Main-axis distribution, which is horizontal in a row. | Defaults to JustifyContent::Start. |