Binding
Wraps the Tweakpane addBinding method.
Important: This component is provided for consistency with Tweakpane's API, but is not recommended for general use in Svelte Tweakpane UI because more helpful abstractions are available.
Please consider convenience components like <Slider>, <Color>, etc. etc. before using this
component directly.
Usage outside of a <Pane> component will implicitly wrap the component in <Pane position="inline">.
Example
Section titled “Example”Value: 0
<script lang="ts"> import { Binding, type BindingObject } from 'svelte-tweakpane-ui'
let object: BindingObject = { r: 0 }</script>
<Binding bind:object key="r" label="Reticulation" /><pre>Value: {object.r}</pre>objectSection titled “object” | |
| Description | The binding's target object with values to manipulate. |
|---|---|
| Type | Bindable |
| required | |
| Description | The key for the value in the target |
|---|---|
| Type | string |
disabledSection titled “disabled” | |
| Description | Prevent interactivity and gray out the control. |
|---|---|
| Type | boolean |
| Default | false |
| optional | |
| Description | Text displayed next to control. |
|---|---|
| Type | string |
| Default | undefined |
optionsSection titled “options” | |
| Description | Tweakpane's internal options object. See Valid types are contingent on the type of the value This is intended internal use, when implementing convenience components wrapping Binding's functionality. Options of interest are instead exposed as top-level props in Svelte Tweakpane UI. |
|---|---|
| Type | BindingParams |
| Default | undefined |
| optional | |
| Description | Custom color scheme. |
|---|---|
| Type | Theme |
| Default | undefined Inherits default Tweakpane theme equivalent to ThemeUtils.presets.standard, or the theme
set with setGlobalDefaultTheme(). |
| bindablereadonlyoptional | |
| Description | Reference to internal Tweakpane
This property is exposed for advanced use cases only, such as when implementing convenience
components wrapping Direct manipulation of Tweakpane's internals can break Svelte Tweakpane UI abstractions. |
|---|---|
| Type | BindingRef |
pluginSection titled “plugin” | |
| Description | Imported Tweakpane This property is exposed for advanced use cases only, such as when implementing convenience
components wrapping Direct manipulation of Tweakpane's internals can break Svelte Tweakpane UI abstractions. |
|---|---|
| Type | TpPluginBundle |
| Default | undefined |
Events
Section titled “Events”changeSection titled “change” | |
| Description | Fires when the value of This event is provided for advanced use cases. It's usually preferred to bind to the The |
|---|---|
| Extends | ValueChangeEvent |
| Type | BindingChangeEvent |