TheBigSasha / tbsui-ssr

CSS only React component library, built for static sites using NextJS or Gatsby.
https://thebigsasha.github.io/tbsui-ssr/
MIT License
0 stars 0 forks source link

Optional Event Callbacks for Nav #26

Open TheBigSasha opened 1 year ago

TheBigSasha commented 1 year ago

Add optional event callbacks to the nav component so that people can use optional client side logic to programatically control the nav, IE, pass a callback of the format

(menuSwitchID: string) => void

Which would be called whenever clicking off of the nav, on the button, or other reasonable slots.

We should also somehow see if we can expose the generated ID for the navbar closer to consumers of the library, perhaps with a vite extension, exporting a Typescript definition like TBSUI-SSR-NAVBAR-TOGGLE-ID.