This is how I built my navigation menu, dropdown, and button components in Astro.
Nav Bar Component
I created a Nav bar component for my site, in it I import Button and DropdownMenu components in addition to two logos, one for mobile and one for desktop.
Button Component
I created a button component with variable styling including the ability to add a caret icon when the button is being used to trigger a dropdown menu. The button component accepts several props including name, link, id, showCaret, and styles which are used to customize the button component when it’s called.
Dropdown Menu Component
The DropdownMenu component uses the Button component to open a dropdown menu with links to project pages on my website.