Skip to content

defineParts not documented #1013

Answered by mayteio
DmacMcgreg asked this question in Q&A
Discussion options

You must be logged in to vote

Docs would be cool! AFAIK ark/zag.js automatically adds the data-part attributes to each dom element it creates. then when you define a recipe (using anatomy from ark -> zag) the css() or recipe() maps to these data-part selectors.

Using ark or zag.js

import { editableAnatomy } from '@ark-ui/react';
import { defineParts, defineRecipe } from '@pandacss/dev';

const parts = defineParts(editableAnatomy.build());

export const textField = defineRecipe({
  name: 'textField',
  base: parts({
    root: {},
    label: {},
    area: {}
});

<Editable className={textField()}> // automatically adds classes for the sub-components which already have the data-parts.
...
</Editable>

Ark does this automa…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by astahmer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants