Skip to content

Progress step ​

This component represents a step in the execution of a command showing the time it took to complete.

PropertyValue
InteractivityNon-required. The component supports non-interactive mode.

Demo ​

Interactive ​

It shows the execution of a command with an interactive progress step

Non-interactive ​

It shows the execution of a command with a non-interactive progress step

API ​

Example ​

swift
let graph = try await Noora().progressStep(
    message: "Processing the graph",
    successMessage: "Project graph processed",
    errorMessage: "Failed to process the project graph"
) { updateMessage in
    // An example of an asynchronous task.
    let graph = try await loadGraph()

    // You can use updateMessage to update the progress step message.
    updateMessage("Analyzing the graph")

    // Another asynchronous task.
    try await analyzeGraph(graph)

    return graph
}

Options ​

AttributeDescriptionRequiredDefault value
messageThe message to show to the userYes
successMessageThe message to show to the user when the step is successfulNo
errorMessageThe message to show to the user when the step failsNo
showSpinnerWhether to show a spinnerNotrue
taskThe task to executeYes

Released under the MIT License.