diff --git a/docs/src/app/(docs)/concepts/theming/page.mdx b/docs/src/app/(docs)/concepts/theming/page.mdx index d28e561f3..8484c1eab 100644 --- a/docs/src/app/(docs)/concepts/theming/page.mdx +++ b/docs/src/app/(docs)/concepts/theming/page.mdx @@ -509,3 +509,51 @@ type UploadDropzoneProps = { + + +## Unstyled Primitive Components + +These components allow you to bring your own styling solution while not having to implement any of the internals. They accept any normal HTML props and can be assigned specific HTML tags through the `as` prop. + +### Setup + +```ts {{ title: 'src/utils/uploadthing.ts' }} +import { generateUploadPrimitives } from "@uploadthing/react"; + +import type { OurFileRouter } from "~/server/uploadthing"; + +export const UT = generateUploadPrimitives(); +``` + +### Example of Dropzone + +The `dropzone` parameter will only be defined from within children of the `Dropzone` component. + +```jsx + + + {({ dropzone, state }) => ( +
+

Drag and drop

+ + {state === "uploading" ? "Uploading" : "Upload file"} + + +
+ )} +
+
+``` + +### Example of Button + +```jsx + + + {({ state }) => state === "uploading" ? "Uploading" : "Upload file"} + + +```