Components

ColorPicker

ColorPicker wraps the native color input while keeping SwiftUI-style label and value semantics.

Example

Requires React 18.2+ or 19 and shared styles. See setup.

Default

Loading preview…

Code
'use client';
import { useState } from 'react';
import { ColorPicker } from '@swiftuijs/ui';
function DemoColorPicker() {
    const [value, setValue] = useState('#0a84ff');
    return <ColorPicker label="Accent" onChange={setValue} value={value}/>;
}
export default function Example() {
    return (<DemoColorPicker />);
}

API reference

PropTypeRequiredDescription
labelstringYesAccessible label shown next to the color control.
valuestringYesCurrent color value.
onChange(value: string) => voidYesCalled when the selected color changes.

Inherits additional props from IBaseComponent.