diff --git a/.changeset/eighty-timers-march.md b/.changeset/eighty-timers-march.md new file mode 100644 index 0000000000..2920ae1a57 --- /dev/null +++ b/.changeset/eighty-timers-march.md @@ -0,0 +1,5 @@ +--- +"@clerk/astro": minor +--- + +Add support for custom menu items in the `` Astro component. diff --git a/integration/presets/astro.ts b/integration/presets/astro.ts index f9a437e864..a34a07e477 100644 --- a/integration/presets/astro.ts +++ b/integration/presets/astro.ts @@ -9,7 +9,10 @@ const astroNode = applicationConfig() .setName('astro-node') .useTemplate(templates['astro-node']) .setEnvFormatter('public', key => `PUBLIC_${key}`) - .addScript('setup', 'npm i') + // When creating symlinks, the Astro vite plugin is unable to process ` diff --git a/packages/astro/src/astro-components/interactive/UserButton/UserButton.astro b/packages/astro/src/astro-components/interactive/UserButton/UserButton.astro new file mode 100644 index 0000000000..669e35aa04 --- /dev/null +++ b/packages/astro/src/astro-components/interactive/UserButton/UserButton.astro @@ -0,0 +1,29 @@ +--- +import type { UserButtonProps, UserProfileProps, Without } from "@clerk/types"; + +type Props = Without & { + userProfileProps?: Pick; + /** + * If you have more than one UserButton on a page, providing a custom ID is required + * to properly scope menu items to the correct button. + * + * Example usage: + * ```tsx + * + * + * + * + * + * + * + * ``` + */ + id?: string; +} + +import InternalUIComponentRenderer from '../InternalUIComponentRenderer.astro' +--- + + + + diff --git a/packages/astro/src/astro-components/interactive/UserButton/UserButtonAction.astro b/packages/astro/src/astro-components/interactive/UserButton/UserButtonAction.astro new file mode 100644 index 0000000000..d95566d303 --- /dev/null +++ b/packages/astro/src/astro-components/interactive/UserButton/UserButtonAction.astro @@ -0,0 +1,24 @@ +--- +import MenuItemRenderer from './MenuItemRenderer.astro'; + +type ReorderItemsLabels = 'manageAccount' | 'signOut' + +type Props