Components
Composable
Code

Composable

Defines a composable child inside of a Compose component

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

Parameters

props

  • Type: @vtex/shoreline-components.ComposableProps

Props

children

  • Type: @types/react.React.ReactNode

render (optional)

  • Type: @vtex/shoreline-utils.RenderProps

View source (opens in a new tab)