New to Telerik UI for BlazorStart a free 30-day trial

A component that lets you pick a color with a gradient canvas, hue/alpha sliders, and format toggle. Supports RGB/HEX formats, optional opacity editor, size variants, ARIA labeling, keyboard focus handling, and two-way value binding.

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Syntax:

C#
public class TelerikColorGradient : BaseComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable, IColorGradientSettings

Inheritance: objectComponentBaseBaseComponentTelerikColorGradient

Implements: IColorGradientSettingsIComponentIDisposableIHandleAfterRenderIHandleEvent

Inherited Members BaseComponent.ShouldRender()BaseComponent.OnInitializedAsync()BaseComponent.Dispose()BaseComponent.InitLocalizer()BaseComponent.ThrowIfParameterIsNull(object, string)BaseComponent.HaveOptionsChanged(IDictionary<string, object>, IDictionary<string, object>)BaseComponent.GetClassString(params string[])BaseComponent.InvokeAsync<T>(string, params object[])BaseComponent.InvokeAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidAsync(string, params object[])BaseComponent.InvokeVoidAsyncWithoutAwait(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidComponentMethodAsync(string, params object[])BaseComponent.InvokeComponentVoidMethodAsync(string, object)BaseComponent.InvokeDisposeAsync()BaseComponent.StateHasChanged()BaseComponent.RootComponentBaseComponent.ClassComponentBase.OnInitialized()ComponentBase.OnParametersSet()ComponentBase.OnAfterRender(bool)ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)ComponentBase.DispatchExceptionAsync(Exception)...

Constructors

C#
public TelerikColorGradient()

Methods

C#
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters:__builderRenderTreeBuilder

Overrides: ComponentBase.BuildRenderTree(RenderTreeBuilder)

C#
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters:firstRenderboolReturns:

Task

Overrides: BaseComponent.OnAfterRenderAsync(bool)

C#
protected override Task OnParametersSetAsync()
Returns:

Task

Overrides: ComponentBase.OnParametersSetAsync()

C#
public override Task SetParametersAsync(ParameterView parameters)
Parameters:parametersParameterViewReturns:

Task

Overrides: ComponentBase.SetParametersAsync(ParameterView)

Properties

[Accessibility] Describe the aria-label attribute for the component.

C#
[Parameter]
public string AriaLabel { get; set; }

Specifies if the ColorGradient is in an enabled or disabled state. The default value is true and the component accepts user interaction.

C#
[Parameter]
public bool Enabled { get; set; }

Specifies the value format, which users see initially. Supports Rgb and Hex formats. The default value is Rgb.

C#
[Parameter]
public ColorFormat Format { get; set; }

Implements: IColorGradientSettings.Format

Fires when the user clicks on the toggle button, which changes the input format.

C#
[Parameter]
public EventCallback<ColorFormat> FormatChanged { get; set; }

Defines the available color formats, which the user can see or use to select a color. The default list contains Rgb and Hex formats.

C#
[Parameter]
public IEnumerable<ColorFormat> Formats { get; set; }

Implements: IColorGradientSettings.Formats

The HTML id attribute of the component.

C#
[Parameter]
public string Id { get; set; }

Defines the visibility of the opacity slider. Default value is true. When opacity is disabled, the ColorPicker Value will not include an alpha part.

C#
[Parameter]
public bool ShowOpacityEditor { get; set; }

Implements: IColorGradientSettings.ShowOpacityEditor

Specifies the size of the ColorGradient.

C#
[Parameter]
public string Size { get; set; }

[Accessibility] Specifies the tab index of the component for keyboard navigation.

C#
[Parameter]
public int? TabIndex { get; set; }

Specifies the color value of the component in a valid css format - hexadecimal (ex: #fff, #ffffff, #ffffff70) and rgb (ex: rgb(0, 0, 0), rgba(0,0,0, 0.6).

C#
[Parameter]
public string Value { get; set; }

The event fires when the value of the ColorGradient changes.

C#
[Parameter]
public EventCallback<string> ValueChanged { get; set; }

Defines the color format, which the component will return in the application code. Supports Rgb and Hex formats. The default value is Rgb.

C#
[Parameter]
public ColorFormat ValueFormat { get; set; }