Component

BOBInputColor

Full-featured color input with HSL/RGB/Hex output, an inline or dropdown picker, copy and revert actions.

API reference ↗

Basic usage

Pick anything, or paste a hex/rgb value.
RAZOR
<BOBInputColor @bind-Value="_basic" Label="Color" HelperText="Pick anything, or paste a hex/rgb value." />

Variants

RAZOR
<BOBInputColor @bind-Value="_outlinedValue" Variant="BOBInputVariant.Outlined" Label="Outlined" />
<BOBInputColor @bind-Value="_filledValue" Variant="BOBInputVariant.Filled" Label="Filled" />
<BOBInputColor @bind-Value="_standardValue" Variant="BOBInputVariant.Standard" Label="Standard" />

Sizes

RAZOR
<BOBInputColor @bind-Value="_smallValue" Label="Small" Size="BOBSize.Small" />
<BOBInputColor @bind-Value="_mediumValue" Label="Medium (Default)" Size="BOBSize.Medium" />
<BOBInputColor @bind-Value="_largeValue" Label="Large" Size="BOBSize.Large" />

Color & Background

RAZOR
<BOBInputColor @bind-Value="_colorValue" Label="Custom Color & Background" Color="@PaletteColor.Secondary" BackgroundColor="@PaletteColor.SecondaryContrast" />

Prefix & Suffix

RAZOR
<BOBInputColor @bind-Value="_prefixValue" Label="With Prefix Icon"
               PrefixIcon="@BOBIconKeys.MaterialIconsOutlined.i_palette"
               PrefixBackgroundColor="white"
               PrefixColor="black" />
<BOBInputColor @bind-Value="_suffixValue" Label="With Suffix Icon"
               SuffixIcon="@BOBIconKeys.MaterialIconsOutlined.i_palette"
               SuffixBackgroundColor="white"
               SuffixColor="black" />

Output formats

Pick the serialization format that matches your back-end.

RAZOR
<BOBInputColor @bind-Value="_hex" Label="HEX" OutputFormat="ColorOutputFormats.Hex" />
<BOBInputColor @bind-Value="_hex" Label="HEXA" OutputFormat="ColorOutputFormats.HexA" />
<BOBInputColor @bind-Value="_rgba" Label="RGB" OutputFormat="ColorOutputFormats.Rgb" />
<BOBInputColor @bind-Value="_rgba" Label="RGBA" OutputFormat="ColorOutputFormats.Rgba" />
<BOBInputColor @bind-Value="_rgba" Label="Optimized" OutputFormat="ColorOutputFormats.Optimized" />

Display modes

RAZOR
<BOBInputColor @bind-Value="_inline" Label="Dropdown" DisplayMode="ColorPickerDisplayMode.Dropdown" />
<BOBInputColor @bind-Value="_inline" Label="Modal" DisplayMode="ColorPickerDisplayMode.Modal" />

Clearable

Clear reverts to initial value (nullable)
Clear reverts to initial value (not nullable)
RAZOR
<BOBInputColor @bind-Value="_clearableNull" HelperText="Clear reverts to initial value (nullable)"
               Label="Clearable Nullable" Clearable="true" ShowCopyButton="true" />
<BOBInputColor @bind-Value="_clearableNotNull" HelperText="Clear reverts to initial value (not nullable)"
               Label="Clearable NotNullable" Clearable="true" ShowCopyButton="true" />

Shadow

RAZOR
<BOBInputColor @bind-Value="_shadowValue" Variant="BOBInputVariant.Outlined" Label="Elevation Shadow" Shadow="@BOBShadowPresets.Elevation(2)" />
<BOBInputColor @bind-Value="_shadowValue" Variant="BOBInputVariant.Outlined" Label="Custom Shadow" Shadow="@(ShadowStyle.Create(5, 10, 0.14f, color: "purple"))" />

States

Required
Disabled
ReadOnly
RAZOR
<BOBInputColor @bind-Value="_requiredValue" Label="Required" Required="true" HelperText="Required" />
<BOBInputColor @bind-Value="_disabledValue" Label="Disabled" Disabled="true" HelperText="Disabled" />
<BOBInputColor @bind-Value="_readOnlyValue" Label="Read Only" ReadOnly="true" HelperText="ReadOnly" />

Responsive Picker

Canvas adapts to its container width via CSS aspect-ratio.
RAZOR
<BOBInputColor @bind-Value="_customPickerValue" Label="Responsive Picker"
               HelperText="Canvas adapts to its container width via CSS aspect-ratio." />

Standalone picker

Use BOBColorPicker directly — no input field, just the picker.

RAZOR
<BOBColorPicker @bind-Value="_standalone" />

Properties

22 rows.
PropertyTypeDefaultDescription
SizeBOBSizeBOBSize.MediumVisual size of the input.
LoadingboolWhen , the input shows a loading indicator.
LoadingIndicatorVariantBOBLoadingIndicatorVariantBOBLoadingIndicatorVariant.CircularProgressVariant of the loading indicator shown when is .
ShadowShadowStyle?Shadow style applied to the input container.
BackgroundColorstring?Background color of the input. Accepts any valid CSS color value.
Colorstring?Text color of the input. Accepts any valid CSS color value.
PrefixTextstring?Text displayed before the input value.
PrefixIconIconKey?Material icon name for the Prefix.
PrefixColorstring?Prefix color. Accepts any valid CSS color value.
PrefixBackgroundColorstring?PrefixBackground color. Accepts any valid CSS color value.
SuffixTextstring?Text displayed after the input value.
SuffixIconIconKey?Material icon name for the Suffix.
SuffixColorstring?Suffix color. Accepts any valid CSS color value.
SuffixBackgroundColorstring?SuffixBackground color. Accepts any valid CSS color value.
Labelstring?Floating label displayed above the input when it has a value or focus.
HelperTextstring?Helper text displayed below the component for additional context.
Placeholderstring?"#000000"Placeholder text shown when the component is empty.
ShowCopyButtonboolWhen , the CopyButton is shown.
ClearableboolWhen , a clear button reverts the value to .
DisplayModeColorPickerDisplayModeColorPickerDisplayMode.DropdownLayout used to expose the color editor: dropdown, popover, or inline panel.
OutputFormatColorOutputFormatsString format used to serialize the picked color (hex, rgb(a), hsl(a), etc.).
RevertTextstring"Revert"Text displayed as the Revert.