aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/molecules/nav/nav-list/nav-list.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/molecules/nav/nav-list/nav-list.tsx')
-rw-r--r--src/components/molecules/nav/nav-list/nav-list.tsx23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/components/molecules/nav/nav-list/nav-list.tsx b/src/components/molecules/nav/nav-list/nav-list.tsx
new file mode 100644
index 0000000..bdf7487
--- /dev/null
+++ b/src/components/molecules/nav/nav-list/nav-list.tsx
@@ -0,0 +1,23 @@
+import { forwardRef, type ReactNode, type ForwardedRef } from 'react';
+import { List, type ListProps } from '../../../atoms';
+
+export type NavListProps<T extends boolean> = Omit<
+ ListProps<T, false>,
+ 'children' | 'hideMarker'
+> & {
+ /**
+ * The nav items.
+ */
+ children: ReactNode;
+};
+
+const NavListWithRef = <T extends boolean>(
+ { children, isInline, ...props }: NavListProps<T>,
+ ref: ForwardedRef<HTMLUListElement | HTMLOListElement>
+) => (
+ <List {...props} hideMarker isInline={isInline} ref={ref}>
+ {children}
+ </List>
+);
+
+export const NavList = forwardRef(NavListWithRef);