Plugin Architecture
The core only keeps color state and an event bus. Box, Panel, Input, Button and friends are plugins you can register, drop, or extend freely.
Small, composable, extensible. The core only owns color state and events — the UI is assembled from plugins.
A real, running color picker rendered directly from the built artifacts.
Install, import the styles, create an instance — three steps to your first picker.
Every constructor option, plugin switch, callback and default value.
What each of the 10 built-in plugins does, how to configure them, and how to compose them.
Follow the pluginName / applyOrder contract to build a registrable, destroyable plugin.
One container, one stylesheet, one constructor call.
<link rel="stylesheet" href="@ew-color-picker/style/dist/index.css" />
<link rel="stylesheet" href="@ew-color-picker/style/dist/input-number.css" />
<div id="picker"></div>
<script type="module">
import ewColorPicker from '@ew-color-picker/ew-color-picker'
const picker = new ewColorPicker({
el: '#picker',
defaultColor: '#6366f1',
predefineColor: ['#6366f1', '#8b5cf6', '#06b6d4', '#22c55e'],
changeColor(color) {
console.log('Current color:', color)
}
})
</script>