#[non_exhaustive]pub struct HeaderItem {
pub key: Option<Arc<str>>,
pub content: HeaderItemContent,
pub label: Option<Arc<str>>,
pub disabled: bool,
pub press_id: u32,
pub menu: Option<Vec<MenuItem>>,
pub shares_background: bool,
}Expand description
An iOS navigation-bar button (ios={{ headerLeftItems }}, ios={{ headerRightItems }}), as
the platform sees it: numeric ids for presses and menu actions report
the root’s EventKind::Menu. Rust apps build one with
crate::element::header::HeaderItem (handlers included); JS sets
onPress / MenuItem.onSelect and the runtime assigns the ids.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.key: Option<Arc<str>>Optional key for keeping a UIBarButtonItem across updates: a kept
button takes the new title, symbol, label, menu and state in place.
Without a key, a button is kept only while its position and its
content are unchanged; any other change makes a new one. It is also
the button’s accessibility identifier, as a view’s testID is:
tests name it by id:<key>.
content: HeaderItemContentWhat the button shows.
label: Option<Arc<str>>VoiceOver’s label when the content is a system item or symbol
(the content’s own text when it is a HeaderItemContent::Label;
the title when it is a HeaderItemContent::SymbolTitle and this
is None).
disabled: boolWhether the button is disabled.
press_id: u32Reported as the root’s EventKind::Menu when pressed with no
menu (0: no handler).
A native pull-down menu of crate::desktop::MenuItems; a press
opens it instead of reporting Self::press_id.
Whether the button shares its background with the bar buttons next
to it (default true). iOS 26 and later draw neighboring buttons in
one glass capsule; false gives this one a capsule of its own
(UIBarButtonItem.sharesBackground). Earlier iOS versions draw no
such background and ignore it.
Trait Implementations§
Source§impl Clone for HeaderItem
impl Clone for HeaderItem
Source§impl Debug for HeaderItem
impl Debug for HeaderItem
Source§impl HostValue for HeaderItem
An iOS bar button: { key?, systemItem | symbol (title?) | label, disabled?, menu? }. Handlers (onPress, menu onSelect) are taken by
the JS runtime when it sets the prop; this decode leaves their ids at 0.
impl HostValue for HeaderItem
An iOS bar button: { key?, systemItem | symbol (title?) | label, disabled?, menu? }. Handlers (onPress, menu onSelect) are taken by
the JS runtime when it sets the prop; this decode leaves their ids at 0.
Source§impl IntoReactive<HeaderItem> for HeaderItem
impl IntoReactive<HeaderItem> for HeaderItem
Source§fn into_reactive(self) -> Reactive<HeaderItem>
fn into_reactive(self) -> Reactive<HeaderItem>
Reactive.