Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { ComponentProps } from "svelte";
import AppNav from "./AppNav.svelte";

export default {
title: "Fragments/AppNav",
component: AppNav,
tags: ["autodocs"],
render: (args: {
Component: AppNav;
props: ComponentProps<typeof AppNav>;
}) => ({
Component: AppNav,
props: args,
}),
};

export const Basic = {
args: {
title: "Settings",
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<script lang="ts">
import * as Button from "$lib/ui/Button";
import { cn } from "$lib/utils";
import { ArrowLeft01Icon, Settings02Icon } from "@hugeicons/core-free-icons";
import type { HTMLAttributes } from "svelte/elements";
interface IHeroProps extends HTMLAttributes<HTMLElement> {
title?: string;
titleClasses?: string;
}
const { title, titleClasses, ...restProps }: IHeroProps = $props();
const baseClasses = "w-full relative flex justify-center h-14 items-center";
</script>

<nav {...restProps} class={cn(baseClasses, restProps.class)}>
<Button.Icon
icon={ArrowLeft01Icon}
iconSize="md"
iconColor={"black"}
class="absolute left-2"
onclick={() => window.history.back()}
/>
<h4 class={cn(titleClasses)}>
{title}
</h4>
</nav>