Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
200ba8d
chore(appearance): appearance settings for the Button
svdimitr Dec 20, 2021
3accf00
chore(button): button appearance article
svdimitr Dec 21, 2021
5613106
chore(commandbutton): appearance settings
svdimitr Dec 21, 2021
10993b4
chore(docs): options
svdimitr Jan 11, 2022
e4ddd00
chore(buttons): delete images
svdimitr Jan 17, 2022
a79b7d7
chore(buttongroup): delete images
svdimitr Jan 17, 2022
3585028
chore(switch): delete images
svdimitr Jan 17, 2022
7f1289e
chore(docs): revamp of the articles
svdimitr Jan 17, 2022
68a7d41
Update components/buttongroup/appearance.md
svdimitr Jan 18, 2022
8f3dc83
Update components/button/appearance.md
svdimitr Jan 18, 2022
c8668c9
Update components/checkbox/appearance.md
svdimitr Jan 18, 2022
0355c9f
Update components/maskedtextbox/appearance.md
svdimitr Jan 18, 2022
34a2a49
Update components/numerictextbox/appearance.md
svdimitr Jan 18, 2022
183bac6
Update components/switch/appearance.md
svdimitr Jan 18, 2022
2c337bc
Update components/switch/appearance.md
svdimitr Jan 18, 2022
10bcb9f
Update components/switch/appearance.md
svdimitr Jan 18, 2022
058ae93
Update components/textarea/appearance.md
svdimitr Jan 18, 2022
b8359fc
Update components/togglebutton/appearance.md
svdimitr Jan 18, 2022
946e9c2
chore(switch): add tip for usage of track and thumbrounded
svdimitr Jan 18, 2022
398af28
Update components/textbox/appearance.md
svdimitr Jan 18, 2022
dc71302
chore(radiogroup): remove the screenshots from the table
svdimitr Jan 18, 2022
eb54d56
chore(maskedtextbox): place the article as last
svdimitr Jan 18, 2022
8fca96c
chore(button): resolve conflict
svdimitr Jan 18, 2022
222707a
chore(button): redo the styling article for the breaking changes
svdimitr Jan 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
192 changes: 192 additions & 0 deletions components/button/appearance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
---
title: Appearance
page_title: Button Appearance
description: Appearance settings of the Button for Blazor.
slug: button-appearance
tags: telerik,blazor,button,appearance
published: True
position: 35
---

# Appearance Settings

You can control the appearance of the button by setting the following attributes:

* [FillMode](#fillmode)
* [Rounded](#rounded)
* [Shape](#shape)
* [Size](#size)
* [ThemeColor](#themecolor)

You can use all of them together to achieve the desired appearance. This article will explain their effect one by one.

## FillMode

The `FillMode` controls how the TelerikButton is filled. You can set it to a member of the `Telerik.Blazor.ThemeConstants.Button.FillMode` class:

| Class members | Manual declarations |
|------------|--------|
|`Solid` <br /> default value|`solid`|
|`Flat`|`flat`|
|`Outline`|`outline`|
|`Link`|`link`|

>caption The built-in Fill modes

````CSHTML
@* These are all built-in fill modes *@

@{
var fields = typeof(Telerik.Blazor.ThemeConstants.Button.FillMode)
.GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static
| System.Reflection.BindingFlags.FlattenHierarchy)
.Where(field => field.IsLiteral && !field.IsInitOnly).ToList();

foreach (var field in fields)
{
string fillmode = field.GetValue(null).ToString();

<div style="float:left; margin: 20px;">
<TelerikButton FillMode="@fillmode">@fillmode</TelerikButton>
</div>
}
}
````

## Rounded

The `Rounded` parameter applies the `border-radius` CSS rule to the button to achieve curving of the edges. You can set it to a member of the `Telerik.Blazor.ThemeConstants.Button.Rounded` class:

| Class members | Manual declarations |
|------------|--------|
|`Small` |`sm`|
|`Medium`|`md`|
|`Large`|`lg`|
|`Full`|`full`|

>caption The built-in values of the Rounded attribute

````CSHTML
@* The built-in rounded edges of the button. *@

@{
var fields = typeof(Telerik.Blazor.ThemeConstants.Button.Rounded)
.GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static
| System.Reflection.BindingFlags.FlattenHierarchy)
.Where(field => field.IsLiteral && !field.IsInitOnly).ToList();

foreach (var field in fields)
{
string rounded = field.GetValue(null).ToString();

<div style="float:left; margin: 20px;">
<TelerikButton Rounded="@rounded">@rounded</TelerikButton>
</div>
}
}
````

## Shape

The `Shape` attribute defines the geometric shape of the button. You can set it to a member of the `Telerik.Blazor.ThemeConstants.Button.Shape` class:

| Class members | Manual declarations |
|---------------|--------|
| `Rectangle` |`rectangle`|
| `Square` |`square`|
| `Circle` |To create a circular button you should set the `Shape` attribute to **Square**, and the `Rounded` attribute to **Full**|


>note The width and height of the geometric shapes depend on the amount of text in the button, and the size of the font.

>caption The built-in button shapes

````CSHTML
@{
var fields = typeof(Telerik.Blazor.ThemeConstants.Button.Shape)
.GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static
| System.Reflection.BindingFlags.FlattenHierarchy)
.Where(field => field.IsLiteral && !field.IsInitOnly).ToList();

foreach (var field in fields)
{
string shape = field.GetValue(null).ToString();

<div style="float:left; margin: 20px;">
<TelerikButton Shape="@shape">@shape</TelerikButton>
</div>
}
}
````

## Size

You can increase or decrease the size of the button by setting the `Size` parameter to a member of the `Telerik.Blazor.ThemeConstants.Button.Size` class:

| Class members | Manual declarations |
|---------------|--------|
| `Small` |`sm`|
| `Medium` |`md`|
| `Large` |`lg`|

>caption The built-in button sizes

````CSHTML
@{
var fields = typeof(Telerik.Blazor.ThemeConstants.Button.Size)
.GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static
| System.Reflection.BindingFlags.FlattenHierarchy)
.Where(field => field.IsLiteral && !field.IsInitOnly).ToList();

foreach (var field in fields)
{
string size = field.GetValue(null).ToString();

<div style="float:left; margin: 20px;">
<TelerikButton Size="@size">@size</TelerikButton>
</div>
}
}
````

## ThemeColor

The color of the button is controlled through the `ThemeColor` parameter. You can set it to a member of the `Telerik.Blazor.ThemeConstants.Button.ThemeColor` class:

| Class members | Manual declarations |
|------------|--------|
|`Base` <br /> default value |`base`|
|`Primary`|`primary`|
|`Secondary`|`secondary`|
|`Tertiary`|`tertiary`|
|`Info`|`info`|
|`Success`|`success`|
|`Warning`|`warning`|
|`Error`|`error`|
|`Dark`|`dark`|
|`Light`|`light`|
|`Inverse`|`inverse`|


>caption The built-in ThemeColors

````CSHTML
@* The built-in button colors *@

@{
var fields = typeof(Telerik.Blazor.ThemeConstants.Button.ThemeColor)
.GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static
| System.Reflection.BindingFlags.FlattenHierarchy)
.Where(field => field.IsLiteral && !field.IsInitOnly).ToList();

foreach (var field in fields)
{
string themeColor = field.GetValue(null).ToString();

<div style="float:left; margin: 20px;">
<TelerikToggleButton ThemeColor="@themeColor">@themeColor</TelerikToggleButton>
</div>
}
}
````

4 changes: 4 additions & 0 deletions components/button/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ Add a reference to the Button instance to use its methods (for example - `FocusA

* [Using Button Icons]({%slug button-icons%})

>caption The result from the code snippet above

![use css to change the button size](images/button-size-change.png)

## See Also

* [Live Demo: Button](https://demos.telerik.com/blazor-ui/button/index)
Expand Down
8 changes: 1 addition & 7 deletions components/button/styling.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@ There are a few ways to style the Button component:

## Primary Button

Through the primary button styling, you can make the button use a strong color to attract attention. To do that, set its `Primary` property to true.

>caption Button with the Primary color scheme from the current theme

````CSHTML
<TelerikButton Primary="true">Primary</TelerikButton>
````
To set a Primary button you should set the `ThemeColor` parameter to `primary`. [Read the Appearance article for further information...]({%slug button-appearance%}).

## Button Class

Expand Down
Loading