Introduction
Sometimes it might be necessary to use the behaviour of a component on another one. For example you might need a button to behave as a link, or you might want a div
with some component's functionality. Composable components are made to enable that.
In Shoreline the concept of "composable" components are those that support a boolean property called asChild
. When set to true
, this property enables the component to extend its behavior to its child components. That allows the component to keep it's original features, but render as something different.