React
LoadingLoading React…
No event yet
Early previewhamur is not on npm yet. The components are being built in the open, follow along on GitHub.
CompareInputs
The same example, live in each framework. One core underneath, so they should behave the same.
Loading React…
No event yet
Loading Vue…
No event yet
Loading Svelte…
No event yet
Loading Solid…
No event yet
Loading Angular…
No event yet
The attributes each framework puts on the open popup, read from the page.
| Attribute | React | Vue | Svelte | Solid | Angular |
|---|---|---|---|---|---|
role | Closed | Closed | Closed | Closed | Closed |
aria-modal | Closed | Closed | Closed | Closed | Closed |
aria-labelledby | Closed | Closed | Closed | Closed | Closed |
data-open | Closed | Closed | Closed | Closed | Closed |
Nothing open. Open a tile to fill its column.
Each tile sets modal to false, so five popups can be open at once; that is why aria-modal reads absent.
Each tile above runs this file.
import { ColorPicker } from '@hamur/react/color-picker'
import { ColorSwatchPicker } from '@hamur/react/color-swatch-picker'
import { Field } from '@hamur/react/field'
const presets = ['#e5484d', '#f76b15', '#ffc53d', '#46a758', '#0090ff', '#8e4ec6']
export default function ColorPickerExample() {
return (
<Field.Root className="field">
<Field.Label>Accent color</Field.Label>
<ColorPicker.Root className="color-picker-row" defaultValue="#6699cc">
<ColorPicker.Trigger className="button color-picker-trigger">
<ColorPicker.Swatch className="color-swatch" />
</ColorPicker.Trigger>
<ColorPicker.Value className="color-picker-value" />
<ColorPicker.Portal>
<ColorPicker.Positioner sideOffset={8}>
<ColorPicker.Popup className="popover color-picker-popup">
<ColorPicker.Area className="color-picker-area">
<ColorPicker.AreaThumb className="color-picker-thumb" />
</ColorPicker.Area>
<ColorPicker.ChannelSlider
channel="hue"
className="color-picker-slider"
>
<ColorPicker.ChannelSliderThumb
className="color-picker-thumb"
/>
</ColorPicker.ChannelSlider>
<ColorPicker.ChannelSlider
channel="alpha"
className="color-picker-slider color-picker-alpha"
>
<ColorPicker.ChannelSliderThumb
className="color-picker-thumb"
/>
</ColorPicker.ChannelSlider>
<ColorPicker.Input className="input color-picker-input" />
<ColorSwatchPicker.Root className="color-swatch-picker" aria-label="Presets">
{presets.map((color) => (
<ColorSwatchPicker.Item
key={color}
value={color}
className="color-swatch-picker-item"
/>
))}
</ColorSwatchPicker.Root>
<ColorPicker.Close className="button">
Done
</ColorPicker.Close>
</ColorPicker.Popup>
</ColorPicker.Positioner>
</ColorPicker.Portal>
</ColorPicker.Root>
</Field.Root>
)
}
The frameworks against each other only, on the same machine and the same example.
| Framework | Tests | Size | Open | Close | Memory |
|---|---|---|---|---|---|
| React | Not measured yet | Not measured yet | Not measured yet | Not measured yet | Not measured yet |
| Vue | Not measured yet | Not measured yet | Not measured yet | Not measured yet | Not measured yet |
| Svelte | Not measured yet | Not measured yet | Not measured yet | Not measured yet | Not measured yet |
| Solid | Not measured yet | Not measured yet | Not measured yet | Not measured yet | Not measured yet |
| Angular | 4 | Not measured yet | Not measured yet | Not measured yet | Not measured yet |
Size is the gzip of the component's entry with core and dom. Open, Close and Memory are medians in Chromium 156 on Apple M3 Max; Memory is what one open and close leaves on the heap. Tests are Color Picker's passing tests in each framework's suites. [N] is a value not measured yet.
The ColorPicker.Root names in each framework's own syntax.
| Prop | React | Vue | Svelte | Solid | Angular |
|---|---|---|---|---|---|
| value | value | value | value | value | [value] |
| defaultValue | defaultValue | default-value | defaultValue | defaultValue | [defaultValue] |
| onValueChangeevent | onValueChange | @value-change | onValueChange | onValueChange | (valueChange) |
| onValueCommittedevent | onValueCommitted | @value-committed | onValueCommitted | onValueCommitted | (valueCommitted) |
| format | format | format | format | format | [format] |
| colorSpace | colorSpace | color-space | colorSpace | colorSpace | [colorSpace] |
| gamut | gamut | gamut | gamut | gamut | [gamut] |
| open | open | open | open | open | [open] |
| defaultOpen | defaultOpen | default-open | defaultOpen | defaultOpen | [defaultOpen] |
| onOpenChangeevent | onOpenChange | @open-change | onOpenChange | onOpenChange | (openChange) |
| onOpenChangeCompleteevent | onOpenChangeComplete | @open-change-complete | onOpenChangeComplete | onOpenChangeComplete | (openChangeComplete) |
| actionsRef | actionsRef | actions-ref | actionsRef | actionsRef | [actionsRef] |
| modal | modal | modal | modal | modal | [modal] |
| disabled | disabled | disabled | disabled | disabled | [disabled] |
| readOnly | readOnly | read-only | readOnly | readOnly | [readOnly] |
| required | required | required | required | required | [required] |
| labels | labels | labels | labels | labels | [labels] |
| getColorName | getColorName | get-color-name | getColorName | getColorName | [getColorName] |
| locale | locale | locale | locale | locale | [locale] |
| name | name | name | name | name | [name] |
| form | form | form | form | form | [form] |
| inputRef | inputRef | input-ref | inputRef | inputRef | [inputRef] |