Components
Composable
Code

Composable

Composable(props): Element

Defines a composable child inside of a Compose component

Parameters

NameType
propsComposableProps

Returns

Element

Example

function Button({ asChild, children, ...props }) {
  const Composition = asChild ? Compose : "button";
  return (
    <Composition {...props}>
      Prefix <Composable>{children}</Composable>
    </Composition>
  );
}

Defined in

packages/components/src/compose/composable.tsx:17 (opens in a new tab)