Skip to content

Type Slots<S> ​

Slots<S> = { [K in keyof S & string as `render${Capitalize<K>}`]?: FC }

Source: slots.tsx

Slots are components that can override or enhance parts of a root component.

The value of each entry is the component that will be rendered in the slot associated with the corresponding key.

SlotsView can be used to render slots. Slots are ignored if this components has any children. Any missing slots will be replaced with a default component.

createSlots produces a context and provider that can be used to create a component with slots and give them access to a shared context.

Type Parameters ​

S ​

S extends Record<string, FC>

A dictionary mapping each slot name to a component.

Built by Prozilla