|
| 1 | +--- |
| 2 | +title: Wizard Text Wrapping |
| 3 | +description: This article demonstrates how to allow text wrapping for step labels in the Telerik UI for Blazor Wizard component to ensure full text visibility. |
| 4 | +type: how-to |
| 5 | +page_title: How to Enable Text Wrapping in Wizard Step Labels - Telerik UI for Blazor |
| 6 | +slug: wizard-kb-wrap-step-label-text |
| 7 | +tags: telerik, blazor, wizard, css, styles |
| 8 | +res_type: kb |
| 9 | +ticketid: 1671064, 1574805, 1527700 |
| 10 | +--- |
| 11 | + |
| 12 | +## Environment |
| 13 | + |
| 14 | +<table> |
| 15 | + <tbody> |
| 16 | + <tr> |
| 17 | + <td>Product</td> |
| 18 | + <td>Wizard for Blazor</td> |
| 19 | + </tr> |
| 20 | + </tbody> |
| 21 | +</table> |
| 22 | + |
| 23 | +## Description |
| 24 | + |
| 25 | +How to allow the `TelerikWizard` to show the full text of the step labels. For instance, step labels in my Wizard component are getting cut off, and I wish to display the complete text by wrapping it onto the next line. |
| 26 | + |
| 27 | +## Solution |
| 28 | + |
| 29 | +To wrap the Wizard step labels and display the full text, apply custom CSS styles. These styles allow the text to wrap in the Wizard steps and break words if necessary to fit the content within the available space. |
| 30 | + |
| 31 | +>caption Wrap Wizard step label text |
| 32 | +
|
| 33 | +````RAZOR |
| 34 | +<style> |
| 35 | + .k-wizard .k-step .k-step-text { |
| 36 | + white-space: normal; /* Allow text to wrap */ |
| 37 | + word-wrap: break-word; /* Break words if necessary */ |
| 38 | + } |
| 39 | +</style> |
| 40 | +
|
| 41 | +<TelerikWizard @bind-Value="@WizardValue"> |
| 42 | + <WizardSteps> |
| 43 | + <WizardStep Label="Start Start Start Start Start" Icon="@SvgIcon.Gear"> |
| 44 | + <Content> |
| 45 | + <p>Welcome to the Wizard!</p> |
| 46 | + </Content> |
| 47 | + </WizardStep> |
| 48 | + <WizardStep Label="Survey Survey Survey Survey Survey" Icon="@SvgIcon.Pencil"> |
| 49 | + <Content> |
| 50 | + <p>The user is performing some actions...</p> |
| 51 | + </Content> |
| 52 | + </WizardStep> |
| 53 | + <WizardStep Label="Finish" Icon="SvgIcon.Check"> |
| 54 | + <Content> |
| 55 | + <p>Thank you!</p> |
| 56 | + </Content> |
| 57 | + </WizardStep> |
| 58 | + </WizardSteps> |
| 59 | +</TelerikWizard> |
| 60 | +
|
| 61 | +<p><strong>Wizard Value: @WizardValue</strong></p> |
| 62 | +
|
| 63 | +@code { |
| 64 | + private int WizardValue { get; set; } |
| 65 | +} |
| 66 | +```` |
| 67 | + |
| 68 | +## See Also |
| 69 | + |
| 70 | +- [Wizard Overview](https://docs.telerik.com/blazor-ui/components/wizard/overview) |
| 71 | +- [Override the Theme or Apply Custom CSS Styles]({%slug themes-override%}) |
0 commit comments