# Wizard Buttons

This article provides details on the buttons available in the Telerik Wizard.

By default the Wizard provides three buttons, however it also allows option to add custom buttons, so you can configure it to match your desired scenario.

In this article:

* [Default buttons](https://www.telerik.com/blazor-ui/documentation/components/wizard/structure/buttons#default-buttons)
* [Custom buttons](https://www.telerik.com/blazor-ui/documentation/components/wizard/structure/buttons#custom-buttons)

## Default buttons

The Wizard provides the following default buttons:

* `Next` - navigates to the next step of the Wizard. If the next step is <strong>disabled</strong>, the button will also appear as disabled. If the next step is <strong>enabled</strong> the following process will be triggered:
  * Invoke [`OnStepChange`](https://www.telerik.com/blazor-ui/documentation/components/wizard/events#onchange),
  * Go to the next page (if the event is not canceled from `event args`)
  * Invoke [`ValueChanged`](https://www.telerik.com/blazor-ui/documentation/components/wizard/events#valuechanged) after the step is changed

* `Previous` - navigates to the previous step of the Wizard. If the previous step is <strong>disabled</strong>, the button will also appear as disabled. If the previous step is <strong>enabled</strong> the following process will be triggered:
  * Invoke [`OnStepChange`](https://www.telerik.com/blazor-ui/documentation/components/wizard/events#onchange),
  * Go to the previous page (if the event is not canceled from `event args`)
  * Invoke [`ValueChanged`](https://www.telerik.com/blazor-ui/documentation/components/wizard/events#valuechanged) after the step is changed

* `Done` - allows the user to complete the wizard. Invokes the [OnFinish](https://www.telerik.com/blazor-ui/documentation/components/wizard/events#onfinish) event.

> caption Wizard with default buttons

<demo metaUrl="client/wizard/structure/buttons/example-1/" height="520"></demo>

## Custom buttons

The Wizard component allows you to include your custom buttons. You can define the desired buttons under the `WizardButtons` tag of the `TelerikWizard`.

This configuration overrides the whole rendering of the bottom-right section of the Wizard, including the built-in buttons and thus provides a full control over it. If you want to include Next and Previous buttons as per the default setup of the Wizard, you need to also add them inside the `WizardButtons`.

> Custom Wizard buttons do not trigger the component [`OnChange`](https://www.telerik.com/blazor-ui/documentation/components/wizard/events#onchange) and [`OnFinish`](https://www.telerik.com/blazor-ui/documentation/components/wizard/events#onfinish) events. See section [Execute Business Logic With Custom Wizard Buttons](https://www.telerik.com/blazor-ui/documentation/components/wizard/structure/buttons#execute-business-logic-with-custom-wizard-buttons) below.

<demo metaUrl="client/wizard/structure/buttons/example-2/" height="520"></demo>

### Execute Business Logic With Custom Wizard Buttons

The built-in (default) Wizard buttons fire the Wizard [`OnChange`](https://www.telerik.com/blazor-ui/documentation/components/wizard/events#onchange) and [`OnFinish`](https://www.telerik.com/blazor-ui/documentation/components/wizard/events#onfinish) events. This allows the app to execute custom business logic and guide the user to the next or previous step under certain conditions.

Custom Wizard buttons cannot fire the `OnChange` and `OnFinish` events. As a result, custom business logic should be implemented in the `OnClick` events of the buttons. On the other hand, the [Wizard Stepper](https://www.telerik.com/blazor-ui/documentation/components/wizard/structure/stepper) always fires the Wizard `OnChange` event. This creates a situation where user navigation can trigger different events. To execute business logic between steps, use one of the following options:

* [Disable all Stepper steps](https://www.telerik.com/blazor-ui/documentation/components/wizard/structure/stepper#disabled). The user will still be able to navigate with the custom Wizard buttons.
* [Disable Stepper clicks with CSS](https://www.telerik.com/blazor-ui/documentation/components/wizard/structure/buttons#disable-stepper-clicks-with-css). In this way, the Stepper will not look disabled. It is also possible to [hide the Stepper completely](https://www.telerik.com/blazor-ui/documentation/components/wizard/structure/buttons#hide-the-stepper).
* [Call the `OnChange` and `OnFinish` handlers from the button `OnClick` handlers](https://www.telerik.com/blazor-ui/documentation/components/wizard/structure/buttons#call-onchange-and-onfinish-from-button-onclick), to avoid duplicate code.
* Execute the same code in both the step `OnChange` handlers and the button `OnClick` handlers.

### Disable Stepper Clicks with CSS

The code below shows will prevent clicks on all Stepper steps, without making the Stepper look disabled.

> caption Prevent clicks on the Wizard Stepper

<demo metaUrl="client/wizard/structure/buttons/example-3/" height="520"></demo>

### Hide the Stepper

`!important` is required to override an inline `display` style.

> caption Hide the Wizard Stepper completely

<demo metaUrl="client/wizard/structure/buttons/example-4/" height="520"></demo>

### Call OnChange and OnFinish From Button OnClick

> caption Handle OnChange and OnFinish events when using custom Wizard buttons. Cancel the OnChange event.

<demo metaUrl="client/wizard/structure/buttons/example-5/" height="520"></demo>

## See Also

* [Live Demos: Wizard Buttons](https://demos.telerik.com/blazor-ui/wizard/buttons)
