Skip to content

Collapsible step ​

You can use this component to represent a long-running task that streams output showing only the last lines, and collapsing on completion. It's useful if you don't want the user to lose the context of the task being executed.

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

Demo ​

Interactive ​

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

Non-interactive ​

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

API ​

Example ​

swift
try await Noora().collapsibleStep(
    title: "Build",
    successMessage: "Build succeeded",
    errorMessage: "Build failed",
    visibleLines: 3
) { progress in
    try await xcodebuild() { progress($0) }
}

Options ​

AttributeDescriptionRequiredDefault value
titleThe title of the underlying taskYes
successMessageThe message to show to the user when the action is successfulNonil
errorMessageThe message to show to the user when the action failsNonil
visibleLinesThe number of lines to show from the outputNo3
taskThe task to executeYes

Released under the MIT License.