Skip to main content

Crate prime_steps

Crate prime_steps 

Source
Expand description

Steps — port of PrimeNG 21.1.10 p-steps.

Numbered wizard steps in a row: nav.p-steps > ul.p-steps-list > li.p-steps-item with a link, a number and a label. By default the component only displays the current step (readonly); in interactive mode a click and the keys ←/→/Home/End/Enter/ Space switch steps. The current step is driven by the owner via active_index (a value or a signal).

use leptos::prelude::*;
use prime_steps::{Steps, StepsItem};

let model = vec![StepsItem::new().label("Personal"), StepsItem::new().label("Seat"), StepsItem::new().label("Payment")];
let html = Owner::new().with(|| view! { <Steps model=model active_index=1usize /> }.to_html());
assert!(html.contains("p-steps-item-active") && html.contains("aria-current=\"step\"") && html.contains(">3<"));

Structs§

StepsCommand
Item command event.
StepsItem
Steps item (instead of PrimeNG’s MenuItem, without router fields).
StepsProps
Props for the Steps component.
StepsPt
Pass-through parts of Steps.

Enums§

Click
What a click does.

Functions§

Steps
Wizard step indicator.
aria_disabled
Link aria-disabled: the item’s disabled or readonly on an inactive item.
click_outcome
Click outcome (onItemClick): readonly or a disabled item — ignored.
is_activation_key
Enter and Space act as a click.
is_item_disabled
The item is disabled: it has disabled, or readonly is on and the item is not active (isItemDisabled).
item_classes
Item classes: p-steps-item, p-steps-item-active, p-disabled.
key_target
The item that focus moves to on a key; at the bounds it stays the same. None — the key does not move focus.
link_tabindex
Link tabindex without moving focus: -1 for a disabled one, its own (or 0) for the active one, its own (or -1) for the rest (getItemTabIndex).
root_classes
Root classes: p-steps p-component, p-readonly, the user class.