Skip to content

Implement different modes of asChild property: pass it to provided component or use Slot primitive #53

@notcodev

Description

@notcodev

🚀 Feature Proposal

Some radix-ui primitives receives asChild property, current twc implementation does not support forward asChild property to custom components. It would be cool if there was functionality to switch between two modes: provide asChild to component or use Slot component based on asChild prop (current implementation)

Motivation

To properly customize radix-ui primitives

Example

const AccordionItem = twx(AccordionPrimitive.Item).attrs({
  'data-slot': 'accordion-item',
})`border-b last:border-b-0`

Pitch

react-twc will be fully compatible with radix-ui primitives.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions