1.1.0 • Published 2 years ago
@cthacker/next-sidebar v1.1.0
NextJs compliant Sidebar Component.
* Uses FontAwesome CDN link to render <i /> icons in the sidebar links
Benefits:
- Compatible with NextJS 13+
- Easier-to-read code with optional props for customization
- Lots of customization options, with less of the component bloat
Specifications
- Language
- Typescript
- Framework
- React >18+
- NextJS >13+
Props Descriptions
includeImageboolean- Whether to include an image in the top sidebar, useful for company websites
imageSrcstring- The src of the image if included
imageTitlestring- The title of the image if included, text is displayed underneath the image in a slightly smaller font
linksSideBarLink[]- The associated links you want displayed in the sidebar component
SideBarLink (Type)
contentReactNode- The content of the link (usually just text)
iconLinkstring- The font-awesome tag, used to render the respective icon next to the link text.
hasAccessboolean- Whether the current user has access to the link, used for roles, authorization, etc
hrefstring- The href link appended to the anchor tag in the link
onClick(_link: string) => void | Promise- The onClick callback that is fired when the link is clicked, with the link auto-populated into the parameter