Skip to content

PlacementSlotType

A placement slot type definition.

Each slot type provides:

  • A unique id matching a surface type or custom identifier
  • A human-readable label
  • A description of the slot behavior
  • A React component that renders the placement
  • Optional defaultProps for sensible defaults
  • An accepts predicate controlling which outputs this type handles

P extends PlacementSlotProps = PlacementSlotProps

optional accepts?: (output) => boolean

Predicate to determine if this slot type can handle a given output. Defaults to matching on surfaceType. Custom implementations can match on template name, content shape, etc.

boolean


component: ComponentType<P>

The React component that renders this placement type.


optional defaultProps?: Partial<P>

Default props merged with resolved props before rendering.


description: string

Description of this placement type.


id: string

Unique identifier for this slot type (e.g. ‘banner’, ‘modal’, ‘custom:my-widget’).


label: string

Human-readable label for the studio UI.


priority: number

Resolution priority. Higher values are evaluated first when multiple slot types match the same surface type. Use this to let narrow/specific predicates take precedence over broad ones without relying on registration order. Default 0.


surfaceType: "custom" | "inline" | "banner" | "modal" | "tooltip" | "sidebar" | "toast" | "fullscreen" | "email" | "sms" | "push" | "in_page" | "button" | "full_page" | "agent" | "cli"

The surface type this slot type handles, or ‘custom’ for custom types.