0

I am trying to learn Fluent UI, but it doesn't work well. I searched the documentation, and wrote the same codes, but I always get the same result. When I refresh the page, styling disappears and I see an ugly Nav. How can I solve this problem? Or where do I make mistake?

import { Nav, INavLink, INavStyles, INavLinkGroup } from '@fluentui/react/lib/Nav';
import { initializeIcons } from '@fluentui/font-icons-mdl2';


const navStyles: Partial<INavStyles> = {
    root: {
        width: "250px",
        height: "100vh",
        boxSizing: 'border-box',
        border: '1px solid #eee',
        fontSize: 20,
        color: "white",
        backgroundColor: "green"
    },
};

const navLinkGroups: INavLinkGroup[] = [
    {
        links: [
            {
                name: 'Dashboard',
                url: '/',
                key: 'key3',
                
            },
            {
                name: 'Components',
                url: '/',
                key: 'key4',
                
            },
            {
                name: 'Pages',
                url: '/',
                key: 'key6',
                
            },
            {
                name: 'Tables',
                url: '/',
                key: 'key7',
                
            },
        ],
    },
];



const Admin: React.FC = () => {
    initializeIcons();

    return (
        <div>
            <Nav    
                ariaLabel="Nav basic example"
                styles={navStyles}
                groups={navLinkGroups}
                selectedKey="key3"
            />
        </div>
    )

}

export default Admin;
Ozan Bilgiç
  • 215
  • 1
  • 9
  • 1
    What do you mean exactly with ugly? That's the result of provided styles. Can you be more precise with a question. Thanks. https://codepen.io/savkelita/pen/gOozyNZ – Marko Savic Apr 09 '22 at 09:06
  • well I am adding styling to this document, but I cannot see styling on my device and it seems like pure HTML. It works well on codepen also, but I couldn't find a solution for my problem. I am using Next.js with Typescript. – Ozan Bilgiç Apr 09 '22 at 12:24

0 Answers0