Skip to content

SealRenderer

SealRenderer is the low-level component used by SealCanvas. It accepts a complete SealTemplateConfig and a values object, giving you full control over layout, fields, and rendering.

Import

tsx
import { SealRenderer, type SealRendererProps, type SealRendererRef } from '@luohuax/seal-kit'

Props

PropTypeDescription
configSealTemplateConfigFull template configuration: shape, fields, layout, style, effects, export, compliance.
valuesSealFieldValuesField values keyed by field name.
previewScalenumberOn-screen preview scale.
textDirection"horizontal" | "vertical"Override text direction.
singleFieldAutoGridbooleanAuto-compute grid for single-field layouts.

Ref Methods

MethodSignatureDescription
exportAsDataURL(options?: { width?, height?, mimeType?, transparent? }) => Promise<string>Export the rendered seal as a data URL.

Example

tsx
import { useRef } from 'react'
import { SealRenderer, mitomePreset, type SealRendererRef } from '@luohuax/seal-kit'

function App() {
  const ref = useRef<SealRendererRef>(null)

  return (
    <SealRenderer
      ref={ref}
      config={mitomePreset}
      values={{ name: '山田太郎' }}
      previewScale={0.5}
    />
  )
}

When to Use

Use SealRenderer when:

  • You need a custom seal template that is not covered by presets.
  • You are building a visual editor and want to bind fields dynamically.
  • You need fine-grained control over layout grids, fields, and compliance watermarks.

For most use cases, SealCanvas is sufficient.

Released under the MIT License.