pub struct SegmentedControlProps {
pub items: Vec<SegmentedItem>,
pub data_path: Option<String>,
pub size: Size,
pub aria_label: Option<String>,
}Expand description
Props for SegmentedControl — a tightly-packed cluster of toggle/nav links rendered as a single bordered group with no gap between segments.
Items come either as a literal items array or from runtime data via
data_path (controller-built). At least one of the two must be supplied;
items wins when both are present.
Visual model: rounded outer container with a single border, internal
dividers between segments, one segment marked active=true and styled
distinctly. The label can be the literal segment text (e.g. “Oggi”) or a
glyph (e.g. “←”, “→”). Each segment carries an optional aria_label
override for accessibility on glyph-only segments.
Use cases captured by this primitive: date scroll clusters (prev/today/next), view toggles (Day/Month, List/Grid), pagination steppers, mode switchers.
Fields§
§items: Vec<SegmentedItem>Literal items list. Skipped when empty; data_path is the fallback.
data_path: Option<String>JSON Pointer into runtime data resolving to an array of SegmentedItems.
Used when items shape depends on per-request data.
size: SizeVisual size — defaults to default.
aria_label: Option<String>Accessible label for the group (<div role="tablist" aria-label="...">).
Omit when the surrounding context already announces purpose.
Trait Implementations§
Source§impl Clone for SegmentedControlProps
impl Clone for SegmentedControlProps
Source§fn clone(&self) -> SegmentedControlProps
fn clone(&self) -> SegmentedControlProps
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SegmentedControlProps
impl Debug for SegmentedControlProps
Source§impl Default for SegmentedControlProps
impl Default for SegmentedControlProps
Source§fn default() -> SegmentedControlProps
fn default() -> SegmentedControlProps
Source§impl<'de> Deserialize<'de> for SegmentedControlProps
impl<'de> Deserialize<'de> for SegmentedControlProps
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for SegmentedControlProps
impl JsonSchema for SegmentedControlProps
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for SegmentedControlProps
impl PartialEq for SegmentedControlProps
Source§fn eq(&self, other: &SegmentedControlProps) -> bool
fn eq(&self, other: &SegmentedControlProps) -> bool
self and other values to be equal, and is used by ==.