Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Purpose of createAnatomy #1

Open
Nemestos opened this issue Jun 29, 2023 · 3 comments
Open

Purpose of createAnatomy #1

Nemestos opened this issue Jun 29, 2023 · 3 comments

Comments

@Nemestos
Copy link

Nemestos commented Jun 29, 2023

Hello,

const buttonAnatomy = createAnatomy('shadcnButton', ['root'])
const parts = defineParts(buttonAnatomy.build())

What's the purpose of createAnatomy? Would it be, for example, to style a compound component (like a select with radix)?
Thanks for your answer

@astahmer
Copy link
Owner

Hey, it's actually a function borrowed from ark-ui (a framework-agnostic alternative to radix-ui by the chakra team), which itself borrows it from zagjs here

and yes it's meant for exactly this use case !

@Nemestos
Copy link
Author

So we can add style to the component in the same recipe and target after in the JSX with data-part?

@astahmer
Copy link
Owner

yes exactly !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants