Configuration

Every aspect of the editor is driven by a single config object passed to <ImageEditor> or <ImageEditorModal>. This page is the top-level reference — each tool has its own guide with the full option tables.

Overview

Pass a config prop to customize behavior. Every field is optional.

<ImageEditor
  src="/photo.jpg"
  config={{
    tools: ["crop", "adjust", "filter", "text", "shapes"],
    defaultTool: "crop",
    export: {
      formats: ["png", "jpeg", "webp"],
      defaultFormat: "png",
      quality: 0.92,
    },
  }}
  onSave={handleSave}
/>

ImageEditorConfig

OptionTypeDefaultDescription
toolsImageEditorToolId[]allTools to show, in order. See Customize the Toolbar.
defaultToolImageEditorToolId | nullnullTool activated on load.
themeThemeConfig{ preset: "dark" }Colors, radius, and font. See Theming.
colorsstring[]built-insSwatch palette (hex) shared by every color picker.
cropCropToolConfig—Crop Tool options.
adjustAdjustToolConfig—Adjust Tool options.
filterFilterToolConfig—Filter Tool options.
textTextToolConfig—Text Tool options.
shapesShapesToolConfig—Shapes Tool options.
imageImageToolConfig—Image upload limits.
uiUIConfig—Chrome and sidebar options (below).
exportExportConfig—Output formats and save behavior. See Export & Save.
customToolsCustomTool[]—Register your own tools. See Add a Custom Tool.
localestring"en"Active locale. See Localize the UI.
translationsRecord<string, string>—Override individual translation strings.
translateFn(key: string) => string—Custom lookup, called instead of the built-in dictionary.

Available tools

ToolIDDescription
Crop"crop"Crop, rotate, flip, resize with presets
Adjust"adjust"Brightness, contrast, saturation, etc.
Filter"filter"Instagram-style photo filters
Text"text"Rich styles and editable layered compositions in a searchable gallery
Shapes"shapes"Filled, outlined, gradient, image, and abstract graphics in searchable categories
Image"image"Image overlay annotations

Text presets

config.text controls typography defaults and the Text gallery. See Configure Text for authored block, run-style, and composition examples.

OptionTypeDefaultDescription
fontsstring[]built-insFont families shown in text controls.
defaultFontFamilystringfirst fontFamily for new text.
defaultFontSizenumber24Reference size at a 1080px canvas.
defaultColorstring"#ffffff"Fill for new text when the preset omits one.
presetGroupsPresetGroup<TextPreset>[]built-insReplace the complete built-in gallery.
additionalPresetGroupsPresetGroup<TextPreset>[]—Append groups; matching group ids merge presets.
presetsTextStylePreset[]—Deprecated flat compatibility list.

Shape presets

config.shapes controls the Shapes gallery and insertion defaults. See Configure Shapes for gradients, image fills, strokes, and custom paths.

OptionTypeDefaultDescription
presetGroupsPresetGroup<ShapePreset>[]built-insReplace the complete built-in gallery.
additionalPresetGroupsPresetGroup<ShapePreset>[]—Append groups; matching group ids merge presets.
presetsstring[]—Deprecated shape-kind compatibility list.
defaultColorstring"#3b82f6"Fallback color for new shapes.
defaultOpacitynumber1Starting opacity from 0 to 1.
defaultSizenumber0.5Canvas-relative size when a preset omits sizeFraction.

Preset authoring types, including PresetGroup, TextPreset, ShapePreset, and composition types, are exported from @editx/image-editor.

Export

config.export controls the save step. Full walkthrough in Export & Save.

OptionTypeDefaultDescription
formats("png" | "jpeg" | "webp")[]allFormats offered in the export dialog.
defaultFormat"png" | "jpeg" | "webp"firstPre-selected format.
qualitynumber0.92Encoder quality (0–1) for lossy formats.
closeAfterSavebooleanfalseCall onClose after a successful export.
filenamestringderivedBase filename for the built-in download.

UI

config.ui tunes the editor chrome. See Customize the Toolbar and Customize the Chrome.

OptionTypeDefaultDescription
toolSidebar.compactbooleanfalseCollapse the tool rail to icons only.
toolSidebar.groupSeparatorsbooleantrueDividers between tool groups.
titlestring—Title shown in the topbar.
showTitleboolean—Toggle the topbar title.
showCloseButtonbooleanautoShow the close (X) button.
showBackButtonbooleanfalseUse a back arrow instead of X.
unsavedChangesWarningbooleantrueConfirm before closing with unsaved changes.

Next steps