Skip to content

Commit

Permalink
feat(snippets): add Navbar snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
gravitano committed Sep 20, 2022
1 parent bb4c321 commit 996944c
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/ui/src/snippets/Navbar/Navbar.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {Meta, Story} from '@storybook/vue3';
import Navbar from './Navbar.vue';

export default {
title: 'Snippets/Navbar',
} as Meta;

export const Light: Story = () => ({
components: {Navbar},
template: `<Navbar />`,
});
51 changes: 51 additions & 0 deletions packages/ui/src/snippets/Navbar/Navbar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<script setup lang="ts">
import {ref} from 'vue';
const menus = ref([
{
text: 'Home',
to: '/',
},
{
text: 'About',
to: '/about',
},
{
text: 'Contact',
to: '/contact',
},
]);
</script>

<template>
<header class="shadow">
<div
class="
container
mx-auto
px-4
lg:px-0
flex
items-center
justify-between
py-4
"
>
<a class="font-semibold" href="#"> Brand </a>

<nav aria-label="Navigation">
<ul class="flex gap-4 items-center">
<li v-for="menu in menus" :key="menu.text">
<router-link
exact-active-class="font-semibold text-primary"
class="hover:text-primary"
:to="menu.to"
>
{{ menu.text }}
</router-link>
</li>
</ul>
</nav>
</div>
</header>
</template>

0 comments on commit 996944c

Please sign in to comment.