Files
classroomio/packages/ui/src/base/page/page-header.svelte
T

30 lines
695 B
Svelte
Raw Normal View History

<script lang="ts">
import { cn, type WithElementRef } from '../../tools';
import type { HTMLAttributes } from 'svelte/elements';
let {
ref = $bindable(null),
class: className,
2026-03-09 11:18:22 +01:00
isSticky = false,
children,
...restProps
2026-03-09 11:18:22 +01:00
}: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
isSticky?: boolean;
} = $props();
</script>
2026-03-09 11:18:22 +01:00
<div
bind:this={ref}
data-slot="page-header"
class={cn(
'ui:flex ui:my-4 ui:py-2 ui:flex-col',
isSticky && 'ui:sticky ui:top-11 ui:z-10 ui:bg-background',
className
)}
2026-03-09 11:18:22 +01:00
{...restProps}
>
<div class="ui:flex ui:items-start ui:justify-between ui:gap-4 ui:flex-col ui:md:flex-row">
{@render children?.()}
</div>
</div>