The FDS Image Editor provides various custom components to facilitate image editing workflows. Below are the descriptions and usage examples of these components.
<fds-image-editor-progress-bar>
This component displays an overall progress bar for the workflow execution and a sub-progress bar for the current running ComfyUI node.
This component is very useful and easy to use. It shows progress automatically.
<fds-image-editor-toggle>
This component represents a toggle switch.
e.detail
.
{
let newValue = e.detail;
}} value={booleanValue}>
<fds-image-editor-button>
This component represents a button. It can be customized with different properties like icon, title, state, device, type, and size.
string
- The name of the icon.string
- The title of the button.""|"active"|"disabled"
- The state of the button.""|"desktop"|"iPad"
- The device type.""|"button"|"icon"
- The type of the button.string
- The size of the button.
{
// Define background action
}}
>
{
// Clear action
}}
>
Click me
string
- The name of the icon.string
- The title of the button.""|"active"|"disabled"
-The state of the button.""|"button"|"icon"
- The type of the button which can be text or icon only.string
- Optional The size of the button.<fds-image-editor-dialog>
This component represents a dialog box.
string
- Additional class for styling.string
- The width of the dialog.boolean
- Whether the dialog is open or closed.function
- Event handler for when the dialog is closed. Usually the variable used to open the dialog is set to false here.
<!-- Modal content goes here -->
{
// Handle close event
}}
>
<fds-local-files>
This component is used to load local files. In this example, it is configured to load .glb
3D files. The component is used in headless mode, making it invisible, which is the recommended mode. File loading can be triggered by calling the load()
function on the component instance.
string
- Description of the files to be loaded.string
- Design mode of the component. Set to headless
to make it invisible.object
- Specifies the file types that can be loaded.
Below is a complete example of using the <fds-local-files>
component in headless mode along with a button to load a .glb
3D model file.
{
fileLoader3D.load();
}}
>
Load Model...
<fds-local-files>
component is configured to load .glb
3D files and is used in headless mode, making it invisible.fileLoader3D
variable is bound to the <fds-local-files>
component instance.load()
function is called on the fileLoader3D
instance, triggering the file loading process.load3D
function is executed when the file is loaded, allowing you to handle the binary file data.This setup allows for a clean and user-friendly interface where file loading is initiated through a button, while the actual file input element remains hidden.
<fds-image-editor-menu>
With this component a multi level pop-up menu can be bind to any UI element (like a button). It supports direct JSON data, so there is no need for a complex template here.
menu
- The structure of the menu with name
of an entry and optional items
for a sub menu. Each element needs a unique key.HTML Element
- The element in DOM tree from which the menu gets its position.function
- the callback function which will be called after a menu entry is clicked. Parameters: item
which is the full menu entry object and key
which is the menu entry key.
<script>
let menuButton
</script>
<fds-image-editor-button
type="button"
on:click={openMenu}
bind:this={menuButton}>File...</fds-image-editor-button>
<fds-image-editor-slider>
This component represents a slider input that can be adjusted within a specified range. The slider can be configured to be vertical or horizontal.
string
- The minimum value of the slider.string
- The maximum value of the slider.boolean
- If true
, the slider is displayed vertically.function
- Event handler for the input event, triggered when the slider value changes.number
- The current value of the slider.With window.fds_device = 'iPad'
globally iPad slider design is activated.
{
let newValue = e.target.value;
// Handle the new value
}}
value={currentValue}
/>
Below is a complete example of using the <fds-image-editor-slider>
component with a vertical orientation and handling the input event.
min
parameter sets the minimum value of the slider.max
parameter sets the maximum value of the slider.vertical
parameter, when set to true
, displays the slider vertically.on:input
parameter binds an event handler to the input event, which is triggered whenever the slider value changes.value
parameter sets the current value of the slider.This component allows for intuitive adjustment of values within a specified range, with support for both vertical and horizontal orientations.
Same slider on iPad and desktop