āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā š shadcn/directory/crafter-station/elements/component_preview_usage ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
ComponentPreviewItem is the recommended way to add component previews in MDX. Use it to display one component at a time directly under each section heading.
In your MDX file (e.g., content/providers/clerk.mdx):
### Clerk Sign In
A fully-featured sign-in component with support for email and password authentication.
<ComponentPreviewItem
componentKey="clerk-sign-in"
installUrl="@elements/clerk-sign-in"
category="Authentication"
name="Clerk"
>
<YourSignInComponent />
</ComponentPreviewItem>
### Clerk Sign Up
User registration component with custom field validation.
<ComponentPreviewItem
componentKey="clerk-sign-up"
installUrl="@elements/clerk-sign-up"
category="Authentication"
name="Clerk"
>
<YourSignUpComponent />
</ComponentPreviewItem>
componentKey (required): Identifier for the component (used in analytics and display)children (required): The React component to previewinstallUrl (optional): Installation command URL (e.g., "@elements/clerk-sign-in")category (optional): Category for analytics (default: "Component")name (optional): Provider/page name for analytics (default: "Preview")relevantRegistryItems (optional): Array of registry items to searchclassName (optional): Additional CSS classesYou can pass an object with layout options instead of a direct component:
<ComponentPreviewItem
componentKey="custom-form"
installUrl="@elements/custom-form"
category="Forms"
name="Custom"
>
{{
component: <CustomForm />,
className: "bg-gradient-to-br from-blue-50 to-purple-50",
installUrl: "@elements/custom-form" // Overrides prop installUrl
}}
</ComponentPreviewItem>
ComponentPreview is available if you need to show multiple components together. However, ComponentPreviewItem is recommended for better MDX readability.
### Clerk Sign In
A fully-featured sign-in component with support for email, social auth, and more.
<ComponentPreview
components={{
"clerk-sign-in": <YourComponentHere />
}}
componentInstallUrls={{
"clerk-sign-in": "@elements/clerk-sign-in"
}}
category="Authentication"
name="Clerk"
/>
components: Object with component keys and React nodescomponentInstallUrls: Object mapping component keys to install URLscategory: Category name for analyticsname: Provider name for analyticsrelevantRegistryItems: (Optional) Array of registry items to match againstclassName: (Optional) Additional CSS classesEach preview includes:
<ComponentPreview
components={{
"component-1": {
component: <Component1 />,
className: "bg-gradient-to-br from-blue-50 to-purple-50",
installUrl: "@elements/component-1"
},
"component-2": <Component2 />
}}
componentInstallUrls={{
"component-2": "@elements/component-2"
}}
category="UI"
name="Components"
/>
<ComponentPreview
components={{
"sign-in": <SignInForm />,
"sign-up": <SignUpForm />,
"forgot-password": <ForgotPasswordForm />
}}
componentInstallUrls={{
"sign-in": "@elements/clerk-sign-in",
"sign-up": "@elements/clerk-sign-up",
"forgot-password": "@elements/clerk-forgot-password"
}}
category="Authentication"
name="Clerk"
/>
"clerk-sign-in" ā "Clerk Sign In"The component automatically tracks:
All analytics are sent to Vercel Analytics with relevant context.
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā