Skip to main content

Use a slot when a package needs named callable code. App code calls the public action and stays out of how that target is built, stored, mounted, or replaced.

This recipe builds product.search, a package-owned target for a search box. The app sends a query. Runtime Kit sends bytes to the target. The target returns reply bytes. The app decodes those bytes according to the public reply shape.

When to use this

Use a slot when the user action needs work, not just data display.A slot is package-owned callable code. The package file says the target name and the methods it accepts. The implementation stays inside the package.

What you will build

Folder shape

The artifact is package-owned bytes. The app does not import this file. The app calls product.search.

Boundary file

The boundary declares two public ideas:

App call

The app owns the request contract:

What should happen

What stays stable

Your app keeps calling product.search. The package can change the bytes behind that target without making the React component import implementation code, read a package file, or understand how the slot runs.

Verify the recipe

Use this checklist before wiring the target into a real screen:

Common failures

Extend it

After this works, you can add:
  1. A React search surface that calls product.search from a button or form.
  2. A stored_bytes file with package-owned search data.
  3. A record that gives the surface initial search copy.
  4. A second method when the same target needs another public operation.
Do not add a second direct app-to-implementation path. Keep the action name as the public target.
The public target name and call shape are safe to document. The private implementation, storage layout, and runtime setup stay out of public docs.

Next

Read Send a request for payload conversion, reply bytes, cancellation, and request errors.Read Runtime Kit API for the public function contract.Read Package file for exact slot field rules, method-list rules, artifact path rules, and invalid examples.
Last modified on May 10, 2026