Files
openmotion/packages/design-system/react/PrimaryNavigationRail.tsx
open-design-crew[bot] 2ca4b9766d Migrate Studio actions to the component library and add a UI inspector (#688)
* Migrate Studio actions to the component library and add a UI inspector

* Read inspector counts after mount and wait for live updates in Chrome

---------

Co-authored-by: 罗高 <luogao@users.noreply.github.com>
2026-11-20 10:22:17 +08:00

22 lines
958 B
TypeScript

import { Button } from 'open-design-ui/button';
import { forwardRef, type ComponentPropsWithoutRef, type ReactNode } from 'react';
interface PrimaryNavigationRailProps extends ComponentPropsWithoutRef<'nav'> {
footer?: ReactNode;
}
export function PrimaryNavigationRail({ children, footer, className = '', ...props }: PrimaryNavigationRailProps) {
return (
<nav {...props} className={`om-primary-navigation ${className}`}>
<div className="om-primary-navigation-group">{children}</div>
{footer && <div className="om-primary-navigation-group om-primary-navigation-footer">{footer}</div>}
</nav>
);
}
export const PrimaryNavigationButton = forwardRef<HTMLButtonElement, ComponentPropsWithoutRef<'button'>>(
function PrimaryNavigationButton({ className = '', type = 'button', ...props }, ref) {
return <Button variant="plain" {...props} ref={ref} type={type} className={`om-primary-navigation-button ${className}`} />;
},
);