use fission::prelude::*;
fission_component! {
pub DocumentActions<()> {
props {
back: ActionEnvelope,
save: ActionEnvelope,
}
}
view(actions, _state, cx) =>
Row(
children: [
Button(child: Text(cx.tr("navigation.back")), on_press: actions.back.clone()),
Spacer(flex_grow: 1.0),
Button(child: Text(cx.tr("document.save")), on_press: actions.save.clone()),
],
)
}
Field | Type | Meaning | Notes / default behavior |
|---|---|---|---|
id | Option<WidgetId> | Stable widget identity. | Defaults to None. |
width | Option<f32> | Fixed width. | Defaults to None. |
height | Option<f32> | Fixed height. | Defaults to None. |
flex_grow | f32 | Extra space this spacer should absorb. | Defaults to 0.0. Set this above zero for push-apart behavior. |