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
| Prop | Type | Required | Description |
|---|---|---|---|
label | string | Yes | Accessible label shown next to the color control. |
value | string | Yes | Current color value. |
onChange | (value: string) => void | Yes | Called when the selected color changes. |
Inherits additional props from IBaseComponent.