@vertisanpro/flowbite-react
Version:
Non-Official React components built for Flowbite and Tailwind CSS
12 lines (11 loc) • 710 B
JavaScript
'use client';
import { twMerge } from '@vertisanpro/tailwind-merge';
import React from 'react';
import { mergeDeep } from '../../helpers/merge-deep';
import { useNavbarContext } from './NavbarContext';
export const NavbarLink = ({ active, as: Component = 'a', disabled, children, className, theme: customTheme = {}, ...props }) => {
const { theme: rootTheme } = useNavbarContext();
const theme = mergeDeep(rootTheme.link, customTheme);
return (React.createElement("li", null,
React.createElement(Component, { className: twMerge(theme.base, active && theme.active.on, !active && !disabled && theme.active.off, theme.disabled[disabled ? 'on' : 'off'], className), ...props }, children)));
};