ColorPicker
Color and linear gradient selection with palettes and formats.
When to use
ColorPicker sets the design color, transparency or linear gradient. It is convenient to use in the theme, card or chart editor. For a limited set of pre-known colors, the presets palette is sufficient; For arbitrary selection, leave the channel editor.
The page contains examples of a single color, gradient and custom trigger. The selected color is shown separately from the CSS that the app uses to render the preview.
Meaning and events of
value accepts a color string, color object, or gradient points. For guided editing, save the object obtained from the callback: re-converting HEX, RGB and HSB to strings can round the channels.
| Problem | Setting | Example |
|---|---|---|
| Set initial color | defaultValue |
Basic selection |
| Accept every change | value, onChange |
Controlled color |
| Change model after completing a gesture | onChangeComplete |
Controlled color |
| Allow no color | allowClear, onClear |
Cleaning |
| Edit color transition | mode |
Linear Gradient |
onChange receives the color and the finished CSS string. onChangeComplete reports the completed selection; when controlled only through it, the trigger retains the same color until the end of the gesture. Update the external value in the selected handler. defaultValue specifies the initial local state, not the subsequent reset.
The color object provides toHexString(), toRgbString(), toHsbString(), toRgb() and toHsb(). For CSS use toCssString(); isGradient() and getColors() allow you to distinguish and read gradients. When clearing, save the entire object together with cleared so that the lack of color does not turn back into normal black.
Formats, transparency and palettes
format selects hex/rgb/hsb editor; onFormatChange allows you to control this selection externally. defaultFormat sets the initial format, disabledFormat prohibits switching. The format of the fields does not change the purpose of the second argument to onChange: it remains CSS, including linear-gradient for the gradient. Example formats shows a separate format status.
disabledAlpha removes transparency controls. It does not overwrite the passed value immediately: the opacity condition is applied on the next change. Example without transparency uses this setting separately from disabled, which disables the entire component.
mode selects single, gradient or allows you to switch between them. Gradient points are specified by color and percentage; store the result as color, and get the string for preview or saving. Ready-made palettes combine single colors and gradients into labeled groups. If the lower swatches are below the viewport, scroll the page to reach them. When you use Tab, the page scrolls the focused control into view. Press Enter to expand a group or select a color.
Panel and accessibility
The usual trigger is a button. showText=true adds color text, and snippet showText gets color for its own caption. trigger=hover changes the opening method; open/onOpenChange allow you to control the panel from outside. placement and arrow specify the placement and arrow.
children - Svelte snippet of your own trigger. Keep the accessible name and native semantics of your button; if necessary, control open and aria-expanded explicitly, as in example of your button. Escape closes the panel and returns focus.
panelRender receives the original panel and extra.components.Picker/Presets - also snippets. Panel composition shows the wrapper of the original panel and the composition of its parts. Save the desired Picker so that editing and events remain.
destroyOnHidden recreates the panel after closing; without it, the hidden panel retains local state. The local getPopupContainer overrides the ConfigProvider and is called when opened. classNames and styles accept objects or functions of the component props. styles values can be CSS strings or objects. For your own trigger, its root design is set directly on your button. Semantic styles shows available slots.
ColorPicker CSS prefixes show the global ConfigProvider.prefixCls and the full local prefixCls. An empty string/undefined returns provider inheritance. The local prefix changes the ColorPicker, and Popover, input fields, Slider, Divider, Segmented and Collapse use their own common namespaces. theme.cssVar.prefix sets theme variables separately from classes. Changing the prefix preserves the color, open popup, incomplete HEX, selection, focus and expansion of presets groups. The example also shows an adjacent area with the same local class, its own button and popup container.
ColorPicker uses design tokens from the current theme for its appearance.
Examples
Basic selection
Single color with local state. defaultValue specifies the initial value.
<script lang="ts">
import { ColorPicker } from '@woodger/antd';
</script>
<ColorPicker aria-label={("Basic ColorPicker")} defaultValue="#52c41a" />
Controlled color
The first picker takes the color at each onChange, the second - after onChangeComplete. color objects from callbacks are saved without being converted to a string.
<script lang="ts">
import { ColorPicker, type Color } from '@woodger/antd';
let live = $state<string | Color>('#52c41a');
let committed = $state<string | Color>('#fa8c16');
let changes = $state(0);
</script>
<style>
.example {
display: grid;
gap: 16px;
}
.row {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 12px;
}
output { overflow-wrap: anywhere; }
</style>
<div class="example">
<div class="row">
<ColorPicker aria-label={("Continuous color change")} value={live} showText
onChange={color => { live = color; }} />
<output aria-label={("Continuous color")}>{typeof live === 'string'
? live
: live.toHexString()}</output>
</div>
<div class="row">
<ColorPicker aria-label={("Color after completion")} value={committed} showText
onChange={() => { changes += 1; }}
onChangeComplete={color => { committed = color; }} />
<output aria-label={("Confirmed color")}>{typeof committed === 'string'
? committed
: committed.toHexString()}{("; changes: ")}{changes}</output>
</div>
</div>
Color label
Normal showText, Svelte snippet with color and controlled open panel indicator.
<script lang="ts">
import { ColorPicker } from '@woodger/antd';
let open = $state(false);
</script>
<style>
.example {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 16px;
}
</style>
<div class="example">
<ColorPicker
aria-label={("Text color")}
defaultValue="#52c41a"
showText
allowClear
/>
<ColorPicker aria-label={("Your own color label")} defaultValue="#722ed1">
{#snippet showText(color)}
<span>{("Accent: ")}{(color.toHexString())}</span>
{/snippet}
</ColorPicker>
<ColorPicker aria-label={("Color with opening indicator")} defaultValue="#fa8c16"
{open} onOpenChange={next => { open = next; }}>
{#snippet showText()}<span aria-hidden="true">{(open ? '▴' : '▾')}</span>{/snippet}
</ColorPicker>
</div>
Without transparency
disabledAlpha hides Alpha and makes the next change opaque. For an already defined translucent value, the alpha does not change until edited.
<script lang="ts">
import { ColorPicker } from '@woodger/antd';
</script>
<ColorPicker
aria-label={("Color without transparency")}
defaultValue="#fa8c16"
disabledAlpha
showText
/>
Own button
Own trigger - Button with its own native semantics. Managed open synchronizes aria-expanded.
<script lang="ts">
import { Button, ColorPicker, type Color } from '@woodger/antd';
let color = $state<string | Color>('#722ed1');
let open = $state(false);
</script>
<ColorPicker value={color} {open} onOpenChange={next => { open = next; }}
onChange={next => { color = next; }}>
<Button
aria-haspopup="dialog"
aria-expanded={open}
>{("\n Select accent: ")}{typeof color
=== 'string'
? color
: color.toHexString()}
</Button>
</ColorPicker>
HEX, RGB and HSB
The editor format can be local, managed or fixed. The CSS from onChange is always RGB or linear-gradient.
<script lang="ts">
import { ColorPicker, type ColorFormat } from '@woodger/antd';
let format = $state<ColorFormat>('rgb');
</script>
<style>
.example {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 16px;
}
</style>
<div class="example">
<ColorPicker
aria-label={("HEX format")}
defaultValue="#52c41a"
defaultFormat="hex"
showText
/>
<ColorPicker
aria-label={("Managed format")}
defaultValue="#fa8c16"
{format}
showText
onFormatChange={next => { if (next) format = next; }}
/>
<ColorPicker
aria-label={("Fixed HSB")}
defaultValue="#722ed1"
format="hsb"
disabledFormat
showText
/>
<output
aria-label={("Editor format")}
>{(format.toUpperCase())}</output>
</div>
Panel composition
panelRender receives the original panel and snippets Picker/Presets. Here the standard parts are collected with a header and a finish button.
<script lang="ts">
import { Button, ColorPicker, Divider } from '@woodger/antd';
let open = $state(false);
</script>
<ColorPicker aria-label={("Own color panel")} defaultValue="#52c41a" {open}
onOpenChange={next => { open = next; }}
presets={([{ label: "Accents", colors: ['#52c41a', '#fa8c16', '#722ed1'] }])}>
{#snippet panelRender(_panel, extra)}
<div style="
padding: 4px;
display: grid;
gap: 12px;
">
<strong>{("Project accent")}</strong>
{@render extra.components.Picker()}
<Divider style="margin:0" />
{@render extra.components.Presets()}
<Button onclick={() => { open = false; }}>{("Ready")}</Button>
</div>
{/snippet}
</ColorPicker>
Dimensions
Three trigger sizes: large, medium and small. Without size, the size from the ConfigProvider is used.
<script lang="ts">
import { ColorPicker } from '@woodger/antd';
</script>
<style>
.example {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 16px;
}
</style>
<div class="example">
{#each ['large', 'medium', 'small'] as const as size (size)}
<ColorPicker
aria-label={("ColorPicker Size " + String((size)) + "")}
{size}
defaultValue="#52c41a"
/>
{/each}
</div>
Linear Gradient
Color points and percentages define the gradient. mode allows switching between single color and gradient; the preview uses the CSS from the callback.
<script lang="ts">
import { ColorPicker, type ColorValue } from '@woodger/antd';
let value = $state<ColorValue>([
{ color: '#fa8c16', percent: 0 },
{ color: '#eb2f96', percent: 100 }
]);
let css = $state('linear-gradient(90deg, #fa8c16 0%, #eb2f96 100%)');
</script>
<style>
.example {
display: grid;
gap: 16px;
}
.preview {
height: 64px;
border: 1px solid var(--ant-color-border-secondary);
border-radius: 8px;
}
output { overflow-wrap: anywhere; }
</style>
<div class="example">
<ColorPicker
aria-label={("Gradient editor")}
{value}
mode={['single', 'gradient']}
onChange={(color, nextCss) => { value = color; css = nextCss; }}
/>
<div class="preview" style:background={css} aria-hidden="true"></div>
<output aria-label={("CSS gradient")}>{css}</output>
</div>
Unavailable state
disabled blocks the opening of the panel for both a simple trigger and a trigger with a label.
<script lang="ts">
import { ColorPicker } from '@woodger/antd';
</script>
<style>
.example {
display: flex;
flex-wrap: wrap;
gap: 16px;
}
</style>
<div class="example">
<ColorPicker aria-label={("Color not available")} defaultValue="#52c41a" disabled />
<ColorPicker
aria-label={("Unavailable color with label")}
defaultValue="#722ed1"
disabled
showText
/>
</div>
Cleaning
allowClear adds cleaning to the panel. Save the entire color object to preserve the cleared attribute.
<script lang="ts">
import { ColorPicker, type Color } from '@woodger/antd';
let color = $state<string | Color>('#fa8c16');
let cleared = $state(false);
</script>
<style>
.example {
display: grid;
gap: 16px;
}
output {
overflow-wrap: anywhere;
}
</style>
<div class="example">
<ColorPicker aria-label={("Color cleaning")} value={color} allowClear showText
onChange={next => { color = next; cleared = next.cleared; }}
onClear={() => { cleared = true; }} />
<output aria-label={("Color cleaning result")}>{cleared
? ("Color cleared")
: typeof color === 'string' ? color : color.toCssString()}</output>
</div>
Opening by guidance
trigger="hover" opens the palette with an animation. Moving the pointer away closes it after a short delay.
<script lang="ts">
import { ColorPicker } from '@woodger/antd';
</script>
<ColorPicker
aria-label={("Color by hover")}
defaultValue="#722ed1"
trigger="hover"
showText
/>
Ready-made palettes
Groups presets have a stable key and an initial defaultOpen. Selecting a sample calls the usual onChange.
<script lang="ts">
import { ColorPicker } from '@woodger/antd';
let css = $state('rgb(82, 196, 26)');
</script>
<style>
.example {
display: grid;
gap: 16px;
}
output {
overflow-wrap: anywhere;
}
</style>
<div class="example">
<ColorPicker aria-label={("Ready-made palettes")} defaultValue="#52c41a" showText
presets={([
{
key: 'green', label: "Green palette", colors: [
'#f6ffed',
'#b7eb8f',
'#52c41a',
'#237804'
]
},
{
key: 'warm', label: "Warm palette", defaultOpen: false, colors: [
'#faad14',
'#fa8c16',
'#f5222d'
]
}
])}
onChange={(_color, next) => { css = next; }} />
<output aria-label={("Color from the palette")}>{css}</output>
</div>
Semantic styles
ConfigProvider supplies shared CSS objects, and the local styles function extends them based on component props.
<script lang="ts">
import { ColorPicker, ConfigProvider, type ColorPickerProps } from '@woodger/antd';
const styles = (({ props }) => ({
root: { borderRadius: '12px' },
popup: {
root: {
'--picker-outline-color': props.size === 'small' ? '#52c41a' : '#722ed1',
outline: '2px solid var(--picker-outline-color)'
}
}
})) satisfies NonNullable<ColorPickerProps['styles']>;
</script>
<style>
.example {
display: flex;
flex-wrap: wrap;
gap: 16px;
}
</style>
<ConfigProvider colorPicker={{ styles: { description: { fontWeight: 600 } } }}>
<div class="example">
<ColorPicker
aria-label={("Semantic ColorPicker object")}
defaultValue="#52c41a"
showText
arrow={false}
classNames={{ root: 'color-picker-semantic-root' }}
styles={{
root: { border: '2px dashed #52c41a' },
body: { borderRadius: '50%' }
}}
/>
<ColorPicker
aria-label={("Semantic ColorPicker function")}
defaultValue="#722ed1"
showText
arrow={false}
{styles}
/>
</div>
</ConfigProvider>
Project color and gradient
Applied example from the review saved: green palette, warm gradient and result CSS.
<script lang="ts">
import { ColorPicker, type ColorValue } from '@woodger/antd';
let color = $state<ColorValue>('#52c41a');
let css = $state('#52c41a');
const gradientStart = 'rgb(68,50,30)';
const gradientEnd = 'rgb(235,47,150)';
let gradient = $state<ColorValue>([
{ color: gradientStart, percent: 0 },
{ color: gradientEnd, percent: 100 }
]);
let gradientCss = $state(`linear-gradient(90deg, ${gradientStart} 0%, ${gradientEnd} 100%)`);
</script>
<style>
.example {
display: grid;
gap: 16px;
}
.row {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 12px;
}
.preview {
box-sizing: border-box;
width: 100%;
max-width: 400px;
height: 64px;
border: 1px solid var(--ant-color-border-secondary);
border-radius: 8px;
}
output {
display: block;
overflow-wrap: anywhere;
}
</style>
<div class="example">
<div class="row">
<span>{("Color with a ready-made palette")}</span>
<ColorPicker
aria-label={("Project color")}
value={color}
showText
allowClear
presets={([{
label: "Palette", colors: [
'#52c41a',
'#faad14',
'#fa8c16',
'#f5222d',
'#eb2f96'
]
}])}
onChange={(next, value) => {
color = next;
css = value;
}}
/>
<output aria-label={("Selected color")}>{css}</output>
</div>
<div class="row">
<span>{("Linear Gradient")}</span>
<ColorPicker
aria-label={("Project Gradient")}
value={gradient}
mode={['single', 'gradient']}
showText
onChange={(next, value) => {
gradient = next;
gradientCss = value;
}}
/>
</div>
<div class="preview" style:background={gradientCss} aria-hidden="true"></div>
<output aria-label={("Selected gradient")}>{gradientCss}</output>
</div>
Local prefixCls changes ColorPicker, and Popover, fields, Slider, Divider, Segmented and Collapse separately inherit the common namespace. The neighboring picker uses the same local class, a different common prefix, its own button and popup container. Theme variables are set independently.
CSS prefixes ColorPicker
General and local prefixCls, independent namespaces of nested fields and an adjacent area with its own button and popup container.
<script lang="ts">
import { Button, Checkbox, ColorPicker, ConfigProvider, type Color } from '@woodger/antd';
let custom = $state(true);
let local = $state(true);
let rtl = $state(false);
let color = $state<string | Color>('#52c41a');
let secondary = $state<string | Color>('#722ed1');
let secondaryOpen = $state(false);
let container = $state<HTMLDivElement>();
const prefix = $derived(custom ? 'suite' : 'ant');
const localPrefix = $derived(local ? 'project-color' : '');
const presets = [
{ key: 'green', label: "Main palette", colors: ['#52c41a', '#237804', '#fa8c16'] },
{ key: 'accent', label: "Additional palette", defaultOpen: false,
colors: ['#722ed1', '#eb2f96', '#faad14'] }
];
</script>
<style>
.example,
section {
display: grid;
grid-template-columns: minmax(0, 1fr);
gap: 16px;
min-width: 0;
}
.controls {
display: flex;
flex-wrap: wrap;
gap: 12px;
}
p { margin: 0; }
output { overflow-wrap: anywhere; }
</style>
<div class="example">
<div class="controls">
<Checkbox bind:checked={custom}>{("Common prefix ColorPicker suite")}</Checkbox>
<Checkbox bind:checked={local}>{("Local prefix ColorPicker")}</Checkbox>
<Checkbox bind:checked={rtl}>{("RTL ColorPicker with prefix")}</Checkbox>
</div>
<ConfigProvider prefixCls={prefix} direction={rtl ? 'rtl' : 'ltr'}
theme={{ cssVar: { prefix: 'colors-theme' } }}>
<section aria-label={("Primary ColorPicker with prefix")}>
<div>
<ColorPicker prefixCls={localPrefix} value={color} presets={(presets)} showText
mode={['single', 'gradient']} onChange={next => { color = next; }}
aria-label={("ColorPicker color with prefix")} />
</div>
<output aria-label={("Select ColorPicker with prefix")}>
{typeof color === 'string' ? color : color.toCssString()}
</output>
</section>
<ConfigProvider prefixCls="neighbor">
<section aria-label={("Neighboring ColorPicker with prefix")}>
<div>
<ColorPicker prefixCls={localPrefix} value={secondary} presets={(presets)}
open={secondaryOpen} onOpenChange={next => { secondaryOpen = next; }}
getPopupContainer={() => container!}
onChange={next => { secondary = next; }}>
<Button aria-haspopup="dialog" aria-expanded={secondaryOpen}
aria-label={("Your own ColorPicker button with a prefix")}>
{("Another accent")}
</Button>
</ColorPicker>
</div>
<div bind:this={container} class="popup-container"></div>
<output aria-label={("Adjacent color with prefix")}>
{typeof secondary === 'string' ? secondary : secondary.toCssString()}
</output>
</section>
</ConfigProvider>
</ConfigProvider>
<output
aria-label={("CSS prefix ColorPicker")}
>{("\n General: ")}{prefix}{("; local: ")}{(localPrefix
|| ("from the provider"))}
</output>
<p>
{("Local prefixCls changes ColorPicker, and Popover, fields, Slider, Divider, Segmented and Collapse separately inherit the common namespace. The neighboring picker uses the same local class, a different common prefix, its own button and popup container. Theme variables are set independently.")}
</p>
</div>
Coverage Examples
14 main themes of ant.design live page collated. React rendering functions have been replaced by Svelte snippets; the exact types are determined by the installed package.
| Theme | Example Svelte |
|---|---|
| Basic Usage | Basic selection |
| controlled mode | Controlled color |
| Rendering Trigger Text | Color label |
| Disabled Alpha | Without transparency |
| Custom Trigger | Own button |
| Color Format | HEX, RGB and HSB |
| Custom Render Panel | Panel composition |
| Trigger size | Dimensions |
| Line Gradient | Linear Gradient |
| Disable | Unavailable state |
| Clear Color | Cleaning |
| Custom Trigger Event | Opening by guidance |
| Preset Colors | Ready-made palettes |
| Custom semantic dom styling | Semantic styles |
API
The main parameters were checked against the public ColorPickerProps. The managed value, open and format are updated via the corresponding callbacks.
| Property | Description | Type | Default |
|---|---|---|---|
prefixCls | Full local prefix of ColorPicker and its parts. The empty string/undefined inherit ConfigProvider. Popover, Input, InputNumber, Select, Slider, Divider, Segmented and Collapse use an independent common prefix; The CSS namespace of the theme is set separately. | string | ConfigProvider.prefixCls + "-color-picker" |
value | String, color object from callback, array of points, or null. Control via onChange; bind:value is not supported. | ColorValue | undefined |
defaultValue | Initial local color, read when created. | ColorValue | undefined |
mode | One mode or allowed modes with a switch. | single | gradient | readonly ColorMode[] | single |
format | Managed format. defaultFormat specifies the initial local format. | hex | rgb | hsb | hex |
onChange | Color change; CSS, regardless of editor format, is returned as RGB or linear-gradient. | (color: Color, css: string) => void | — |
onChangeComplete | Drag completion or discrete change. | (color: Color) => void | — |
onFormatChange | For managed format, save the new format externally. | (format?: ColorFormat) => void | — |
open | Controlled panel visibility. onOpenChange reports a request to change it. | boolean | Local |
showText | trigger label: standard text or snippet with the current color. | boolean | Snippet<[Color]> | false |
children | Own trigger, for example Button. Its disabled and available attributes are set inside the snippet. | Snippet | Standard trigger |
presets | Groups with label, colors, optional key and defaultOpen; colors can be gradients. | readonly ColorPickerPreset[] | undefined |
panelRender | Gets panel and extra.components.Picker/Presets - Svelte snippets. | Snippet<[Snippet, { components }]> | Standard panel |
allowClear | Cleaning inside the panel; onClear is called separately. | boolean | false |
disabledAlpha | Removes alpha editing. The next change makes the original translucent color opaque. | boolean | false |
disabledFormat | Hides the format selection, preserving its current fields. | boolean | false |
disabled | Blocks standard trigger and panel opening. | boolean | From context |
size | large, medium and small. | ComponentSize | From context |
trigger | Panel opening event. | click | hover | click |
placement | Preferred placement; autoAdjustOverflow by default true adjusts it at the edge. | ColorPickerPlacement | bottomLeft |
arrow | Panel arrow; can be inherited from ConfigProvider.colorPicker. | boolean | { pointAtCenter?: boolean } | true |
getPopupContainer | The local container takes precedence. Getter is called after the first open. | (trigger: HTMLElement) => HTMLElement | From ConfigProvider |
destroyOnHidden | Destroys the contents of a hidden panel. | boolean | false |
classNames | Classes root, body, content, description and popup.root. | ColorPickerSlots | ((info) => ColorPickerSlots) | undefined |
styles | CSS strings and objects. popupOverlayInner styles the inside of the palette. | ColorPickerStyles | ((info) => ColorPickerStyles) | undefined |
Color and events
Callback returns an object of public type Color. Keep it in a state for editing without loss of accuracy. Available toHexString(), toRgbString(), toHsbString(), toRgb() and toHsb().
toCssString() returns the finished CSS; isGradient() features a gradient, getColors() returns its points. When cleaning, also maintain the property cleared, leaving the entire object.
onChange reports intermediate changes when dragging, onChangeComplete is a completed selection. In the second case, the controlled button remains the same color until the gesture is completed, as in control example.
Semantic DOM
Standard trigger - native button with aria-haspopup and aria-expanded; the panel has the role dialog. Give your trigger an accessible name and state yourself.
| Slot | Purpose |
|---|---|
root | Standard opening button. |
body | Color sample or cleaning mark. |
content | Pouring the sample. |
description | Standard button label. |
popup.root | Object with root: root dialog of the panel. |
Example semantic styles shows object and function. Root slots belong to the standard trigger; For children, design your own button directly. Escape closes the panel and returns focus.
Design
There are no separate ColorPicker component tokens in the public map of the package; There is also no separate table of tokens on the verified official page. Use a common theme, ConfigProvider.colorPicker and semantic styles.
Below are some common current theme tokens via theme.useToken(). These are design guidelines and not a complete list of style dependencies.
| Token | Purpose | Meaning |
|---|---|---|
colorBgContainer | Background trigger. | #ffffff |
colorBgElevated | Panel background. | #ffffff |
colorBorder | trigger frame. | #d9d9d9 |
colorText | Main text. | rgba(0,0,0,0.88) |
colorPrimary | Focus and active elements. | #2f54eb |
controlHeight | Normal trigger height. | 32 |
controlHeightSM | Low height trigger. | 24 |
controlHeightLG | High height trigger. | 40 |
ConfigProvider.colorPicker
The provider passes class, style, arrow, classNames and styles. Local semantic styles take precedence.
<script lang="ts">
import { ColorPicker, ConfigProvider } from '@woodger/antd';
</script>
<ConfigProvider colorPicker={{
arrow: false, styles: {
root: 'border:2px solid #722ed1',
description: 'font-weight:600'
}
}}>
<ColorPicker
aria-label={("Color from ConfigProvider")}
defaultValue="#722ed1"
showText
/>
</ConfigProvider>
FAQ
Why is it better to store a color object?
Converting strings of different formats can round off channels. Save the object from the callback when editing, and receive the string at the display or send border.
Why is the RGB format but the CSS gradient does not change?
format changes the editor fields and signature. ToCssString() and the second argument to onChange provide ready-made CSS regardless of the selected editor.
How to replace React panelRender?
Pass Svelte snippet with the panel and extra arguments. Draw the original panel or extra.components.Picker and presets, as in the panel composition example.