@dxos/react-ui
    Preparing search index...

    Function slottable

    • Factory for slottable components. The implementation receives full HTMLAttributes<E> so it can destructure role, style, etc. Consumers see only SlottableProps<P> — a narrow type exposing classNames, className, children, asChild, and the custom props P.

      Type Parameters

      • E extends HTMLElement
      • P extends object = {}

      Parameters

      • render: (
            props: Omit<P & { asChild?: boolean }, "className"> & {
                classNames?: ClassNameValue;
            } & Pick<HTMLAttributes<Element>, "role" | "children" | "style"> & HTMLAttributes<
                E,
            >,
            forwardedRef: ForwardedRef<E>,
        ) => ReactNode

      Returns ForwardRefExoticComponent<
          Omit<P & { asChild?: boolean }, "className"> & {
              classNames?: ClassNameValue;
          } & Pick<HTMLAttributes<Element>, "role" | "children" | "style"> & RefAttributes<
              E,
          >,
      >

      const MyPanel = slottable<HTMLDivElement, { border?: boolean }>(
      ({ children, asChild, border, ...props }, forwardedRef) => (
      <ark.div asChild={asChild} {...composableProps(props, { classNames: border && 'border' })} ref={forwardedRef}>
      {children}
      </ark.div>
      ),
      );