Skip to content
ui8kit

block / dashboard

Dashboard Shell

Twelve frames of a signed-in app around empty cards: a top bar across the shell or over the content, with or without search; a wide, rail, collapsed, two-level or no sidebar, at the start or the end; a footer across the shell, under the content or none.

Install

npx ui8kit add dashboard-shell

Pulls in: block, box, compose, kit-box, nav-bar, shell-content, shell-footer, shell-sidebar, shell-topbar, utils

Preview

Northwind

Ctrl K

Orders

Code

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework svelte --dir src --registry-url https://registry.buildy.tw/svelte --strict-cdn
npx ui8kit add dashboard-shell
blocks/dashboard-shell.svelte
<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->
<!--
  The frame of a signed-in app around placeholder content. Axes: topbar (full: across the whole shell, inset:
  over the content column only, none), search (show, hide: the search field of the top bar), sidebar (wide,
  rail, collapsed: the static collapsed state, twolevel: a rail and a section panel, none: the top bar carries
  the links), side (start, end), footer (full, inset, none), content (grid, split, list), frame (window: a
  framed window in a section, page: the whole page). Collapsing the sidebar is a port contract.
-->
<script lang="ts" module>
  import type { Snippet } from "svelte";
  import type { ShellNav } from "./dashboard-shell.types";
  import type { NavLink } from "./nav-bar.types";

  export type DashboardShellProps = {
    id: string;
    title: string;
    level?: 1 | 2;
    nav: ShellNav;
    topbar?: "full" | "inset" | "none";
    search?: "show" | "hide";
    sidebar?: "wide" | "rail" | "collapsed" | "twolevel" | "none";
    side?: "start" | "end";
    footer?: "full" | "inset" | "none";
    content?: "grid" | "split" | "list";
    frame?: "window" | "page";
    landmarkLabel?: string;
  };
</script>

<script lang="ts">
  import Block from "../compose/Block.svelte";
  import Box from "../compose/Box.svelte";
  import ShellContent from "../components/shell-content.svelte";
  import ShellFooter from "../components/shell-footer.svelte";
  import ShellSidebar from "../components/shell-sidebar.svelte";
  import ShellTopbar from "../components/shell-topbar.svelte";
  import { cn, tpl } from "../utils";

  let {
    id,
    title,
    level = 2,
    nav,
    topbar = "full",
    search = "show",
    sidebar = "wide",
    side = "start",
    footer = "none",
    content = "grid",
    frame = "window",
    landmarkLabel,
  }: DashboardShellProps = $props();
  const titleId = $derived(tpl("{0}-title", id));
</script>

<Block
  tag="section"
  class={(((frame as string) === "window") ? "bg-background py-12" : "bg-background")}
  id={id}
  aria-labelledby={(landmarkLabel ? undefined : titleId)}
  data-topbar={topbar}
  data-sidebar={sidebar}
  data-footer={footer}
  aria-label={landmarkLabel}
  data-slot="dashboard-shell"
>
  <Box class={(((frame as string) === "window") ? "mx-auto w-full max-w-6xl px-4" : "")}>
    <Box
      class={cn(
        "flex flex-col overflow-hidden bg-background",
        (((frame as string) === "window") ? "min-h-160 rounded border border-border" : "min-h-screen")
      )}
      data-slot="window"
    >
      {#if ((topbar as string) === "full")}
        <ShellTopbar
          nav={nav}
          links={(((sidebar as string) === "none") ? "show" : "hide")}
          search={search}
          landmarkLabel={landmarkLabel}
        />
      {/if}
      <Box class={cn("flex min-h-0 flex-1", (((side as string) === "end") ? "flex-row-reverse" : ""))}>
        {#if ((sidebar as string) !== "none")}
          <ShellSidebar
            nav={nav}
            mode={sidebar}
            side={side}
            brand={(((topbar as string) === "full") ? "hide" : "show")}
            landmarkLabel={landmarkLabel}
          />
        {/if}
        <Box class="flex min-w-0 flex-1 flex-col">
          {#if ((topbar as string) === "inset")}
            <ShellTopbar
              nav={nav}
              brand={(((sidebar as string) === "none") ? "show" : "hide")}
              links={(((sidebar as string) === "none") ? "show" : "hide")}
              search={search}
              landmarkLabel={landmarkLabel}
            />
          {/if}
          <ShellContent title={title} titleId={titleId} level={level} content={content} />
          {#if ((footer as string) === "inset")}
            <ShellFooter nav={nav} place="inset" landmarkLabel={landmarkLabel} />
          {/if}
        </Box>
      </Box>
      {#if ((footer as string) === "full")}
        <ShellFooter nav={nav} landmarkLabel={landmarkLabel} />
      {/if}
    </Box>
  </Box>
</Block>
blocks/dashboard-shell.types.ts
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.

import type { NavLink } from "./nav-bar.types";

export type ShellNav = {
  label: string;
  brand: string;
  links: NavLink[];
  current: string;
  subTitle: string;
  sub: NavLink[];
  subCurrent: string;
  search: string;
  shortcut: string;
  expand: string;
  userName: string;
  copyright: string;
  footerLabel: string;
  footer: NavLink[];
};

Svelte registry item (JSON)

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework react --dir src --registry-url https://registry.buildy.tw/react --strict-cdn
npx ui8kit add dashboard-shell
blocks/dashboard-shell.tsx
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
/**
 * The frame of a signed-in app around placeholder content. Axes: topbar (full: across the whole shell, inset:
 * over the content column only, none), search (show, hide: the search field of the top bar), sidebar (wide,
 * rail, collapsed: the static collapsed state, twolevel: a rail and a section panel, none: the top bar carries
 * the links), side (start, end), footer (full, inset, none), content (grid, split, list), frame (window: a
 * framed window in a section, page: the whole page). Collapsing the sidebar is a port contract.
 */
import { type ReactNode } from "react";
import { Block, Box } from "../compose";
import { ShellContent } from "../components/shell-content";
import { ShellFooter } from "../components/shell-footer";
import { ShellSidebar } from "../components/shell-sidebar";
import { ShellTopbar } from "../components/shell-topbar";
import { cn, tpl } from "../utils";
import type { ShellNav } from "./dashboard-shell.types";
import type { NavLink } from "./nav-bar.types";

export type DashboardShellProps = {
  id: string;
  title: string;
  level?: 1 | 2;
  nav: ShellNav;
  topbar?: "full" | "inset" | "none";
  search?: "show" | "hide";
  sidebar?: "wide" | "rail" | "collapsed" | "twolevel" | "none";
  side?: "start" | "end";
  footer?: "full" | "inset" | "none";
  content?: "grid" | "split" | "list";
  frame?: "window" | "page";
  landmarkLabel?: string;
};

export function DashboardShell({
  id,
  title,
  level = 2,
  nav,
  topbar = "full",
  search = "show",
  sidebar = "wide",
  side = "start",
  footer = "none",
  content = "grid",
  frame = "window",
  landmarkLabel,
}: DashboardShellProps) {
  const titleId = tpl("{0}-title", id);
  return (
    <Block
      tag="section"
      className={(((frame as string) === "window") ? "bg-background py-12" : "bg-background")}
      id={id}
      aria-labelledby={(landmarkLabel ? undefined : titleId)}
      data-topbar={topbar}
      data-sidebar={sidebar}
      data-footer={footer}
      aria-label={landmarkLabel}
      data-slot="dashboard-shell"
    >
      <Box className={(((frame as string) === "window") ? "mx-auto w-full max-w-6xl px-4" : "")}>
        <Box
          className={cn(
            "flex flex-col overflow-hidden bg-background",
            (((frame as string) === "window") ? "min-h-160 rounded border border-border" : "min-h-screen")
          )}
          data-slot="window"
        >
          {((topbar as string) === "full") ? (
            <ShellTopbar
              nav={nav}
              links={(((sidebar as string) === "none") ? "show" : "hide")}
              search={search}
              landmarkLabel={landmarkLabel}
            />
          ) : null}
          <Box className={cn("flex min-h-0 flex-1", (((side as string) === "end") ? "flex-row-reverse" : ""))}>
            {((sidebar as string) !== "none") ? (
              <ShellSidebar
                nav={nav}
                mode={sidebar}
                side={side}
                brand={(((topbar as string) === "full") ? "hide" : "show")}
                landmarkLabel={landmarkLabel}
              />
            ) : null}
            <Box className="flex min-w-0 flex-1 flex-col">
              {((topbar as string) === "inset") ? (
                <ShellTopbar
                  nav={nav}
                  brand={(((sidebar as string) === "none") ? "show" : "hide")}
                  links={(((sidebar as string) === "none") ? "show" : "hide")}
                  search={search}
                  landmarkLabel={landmarkLabel}
                />
              ) : null}
              <ShellContent title={title} titleId={titleId} level={level} content={content} />
              {((footer as string) === "inset") ? (
                <ShellFooter nav={nav} place="inset" landmarkLabel={landmarkLabel} />
              ) : null}
            </Box>
          </Box>
          {((footer as string) === "full") ? (
            <ShellFooter nav={nav} landmarkLabel={landmarkLabel} />
          ) : null}
        </Box>
      </Box>
    </Block>
  );
}
blocks/dashboard-shell.types.ts
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.

import type { NavLink } from "./nav-bar.types";

export type ShellNav = {
  label: string;
  brand: string;
  links: NavLink[];
  current: string;
  subTitle: string;
  sub: NavLink[];
  subCurrent: string;
  search: string;
  shortcut: string;
  expand: string;
  userName: string;
  copyright: string;
  footerLabel: string;
  footer: NavLink[];
};

React registry item (JSON)

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework vue --dir src --registry-url https://registry.buildy.tw/vue --strict-cdn
npx ui8kit add dashboard-shell
blocks/dashboard-shell.types.ts
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.

import type { NavLink } from "./nav-bar.types";

export type ShellNav = {
  label: string;
  brand: string;
  links: NavLink[];
  current: string;
  subTitle: string;
  sub: NavLink[];
  subCurrent: string;
  search: string;
  shortcut: string;
  expand: string;
  userName: string;
  copyright: string;
  footerLabel: string;
  footer: NavLink[];
};
blocks/dashboard-shell.vue
<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->
<!--
  The frame of a signed-in app around placeholder content. Axes: topbar (full: across the whole shell, inset:
  over the content column only, none), search (show, hide: the search field of the top bar), sidebar (wide,
  rail, collapsed: the static collapsed state, twolevel: a rail and a section panel, none: the top bar carries
  the links), side (start, end), footer (full, inset, none), content (grid, split, list), frame (window: a
  framed window in a section, page: the whole page). Collapsing the sidebar is a port contract.
-->
<script lang="ts">
import type { ShellNav } from "./dashboard-shell.types";
import type { NavLink } from "./nav-bar.types";

export type DashboardShellProps = {
  id: string;
  title: string;
  level?: 1 | 2;
  nav: ShellNav;
  topbar?: "full" | "inset" | "none";
  search?: "show" | "hide";
  sidebar?: "wide" | "rail" | "collapsed" | "twolevel" | "none";
  side?: "start" | "end";
  footer?: "full" | "inset" | "none";
  content?: "grid" | "split" | "list";
  frame?: "window" | "page";
  landmarkLabel?: string;
};
</script>

<script setup lang="ts">
import { computed } from "vue";
import Block from "../compose/Block.vue";
import Box from "../compose/Box.vue";
import ShellContent from "../components/shell-content.vue";
import ShellFooter from "../components/shell-footer.vue";
import ShellSidebar from "../components/shell-sidebar.vue";
import ShellTopbar from "../components/shell-topbar.vue";
import { cn, tpl } from "../utils";

const {
  id,
  title,
  level = 2,
  nav,
  topbar = "full",
  search = "show",
  sidebar = "wide",
  side = "start",
  footer = "none",
  content = "grid",
  frame = "window",
  landmarkLabel,
} = defineProps<DashboardShellProps>();
const titleId = computed(() => tpl("{0}-title", id));
</script>

<template>
  <Block
    tag="section"
    :class="(((frame as string) === 'window') ? 'bg-background py-12' : 'bg-background')"
    :id="id"
    :aria-labelledby="(landmarkLabel ? undefined : titleId)"
    :data-topbar="topbar"
    :data-sidebar="sidebar"
    :data-footer="footer"
    :aria-label="landmarkLabel"
    data-slot="dashboard-shell"
  >
    <Box :class="(((frame as string) === 'window') ? 'mx-auto w-full max-w-6xl px-4' : '')">
      <Box
        :class="cn(
          'flex flex-col overflow-hidden bg-background',
          (((frame as string) === 'window') ? 'min-h-160 rounded border border-border' : 'min-h-screen')
        )"
        data-slot="window"
      >
        <ShellTopbar v-if="((topbar as string) === 'full')"
          :nav="nav"
          :links="(((sidebar as string) === 'none') ? 'show' : 'hide')"
          :search="search"
          :landmarkLabel="landmarkLabel"
        />
        <Box :class="cn('flex min-h-0 flex-1', (((side as string) === 'end') ? 'flex-row-reverse' : ''))">
          <ShellSidebar v-if="((sidebar as string) !== 'none')"
            :nav="nav"
            :mode="sidebar"
            :side="side"
            :brand="(((topbar as string) === 'full') ? 'hide' : 'show')"
            :landmarkLabel="landmarkLabel"
          />
          <Box class="flex min-w-0 flex-1 flex-col">
            <ShellTopbar v-if="((topbar as string) === 'inset')"
              :nav="nav"
              :brand="(((sidebar as string) === 'none') ? 'show' : 'hide')"
              :links="(((sidebar as string) === 'none') ? 'show' : 'hide')"
              :search="search"
              :landmarkLabel="landmarkLabel"
            />
            <ShellContent :title="title" :titleId="titleId" :level="level" :content="content" />
            <ShellFooter
              v-if="((footer as string) === 'inset')"
              :nav="nav"
              place="inset"
              :landmarkLabel="landmarkLabel"
            />
          </Box>
        </Box>
        <ShellFooter v-if="((footer as string) === 'full')" :nav="nav" :landmarkLabel="landmarkLabel" />
      </Box>
    </Box>
  </Block>
</template>

Vue registry item (JSON)

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework solid --dir src --registry-url https://registry.buildy.tw/solid --strict-cdn
npx ui8kit add dashboard-shell
blocks/dashboard-shell.tsx
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
/**
 * The frame of a signed-in app around placeholder content. Axes: topbar (full: across the whole shell, inset:
 * over the content column only, none), search (show, hide: the search field of the top bar), sidebar (wide,
 * rail, collapsed: the static collapsed state, twolevel: a rail and a section panel, none: the top bar carries
 * the links), side (start, end), footer (full, inset, none), content (grid, split, list), frame (window: a
 * framed window in a section, page: the whole page). Collapsing the sidebar is a port contract.
 */
import { type JSX } from "solid-js";
import { Block, Box } from "../compose";
import { ShellContent } from "../components/shell-content";
import { ShellFooter } from "../components/shell-footer";
import { ShellSidebar } from "../components/shell-sidebar";
import { ShellTopbar } from "../components/shell-topbar";
import { cn, tpl } from "../utils";
import type { ShellNav } from "./dashboard-shell.types";
import type { NavLink } from "./nav-bar.types";

export type DashboardShellProps = {
  id: string;
  title: string;
  level?: 1 | 2;
  nav: ShellNav;
  topbar?: "full" | "inset" | "none";
  search?: "show" | "hide";
  sidebar?: "wide" | "rail" | "collapsed" | "twolevel" | "none";
  side?: "start" | "end";
  footer?: "full" | "inset" | "none";
  content?: "grid" | "split" | "list";
  frame?: "window" | "page";
  landmarkLabel?: string;
};

export function DashboardShell({
  id,
  title,
  level = 2,
  nav,
  topbar = "full",
  search = "show",
  sidebar = "wide",
  side = "start",
  footer = "none",
  content = "grid",
  frame = "window",
  landmarkLabel,
}: DashboardShellProps) {
  const titleId = tpl("{0}-title", id);
  return (
    <Block
      tag="section"
      class={(((frame as string) === "window") ? "bg-background py-12" : "bg-background")}
      id={id}
      aria-labelledby={(landmarkLabel ? undefined : titleId)}
      data-topbar={topbar}
      data-sidebar={sidebar}
      data-footer={footer}
      aria-label={landmarkLabel}
      data-slot="dashboard-shell"
    >
      <Box class={(((frame as string) === "window") ? "mx-auto w-full max-w-6xl px-4" : "")}>
        <Box
          class={cn(
            "flex flex-col overflow-hidden bg-background",
            (((frame as string) === "window") ? "min-h-160 rounded border border-border" : "min-h-screen")
          )}
          data-slot="window"
        >
          {((topbar as string) === "full") ? (
            <ShellTopbar
              nav={nav}
              links={(((sidebar as string) === "none") ? "show" : "hide")}
              search={search}
              landmarkLabel={landmarkLabel}
            />
          ) : null}
          <Box class={cn("flex min-h-0 flex-1", (((side as string) === "end") ? "flex-row-reverse" : ""))}>
            {((sidebar as string) !== "none") ? (
              <ShellSidebar
                nav={nav}
                mode={sidebar}
                side={side}
                brand={(((topbar as string) === "full") ? "hide" : "show")}
                landmarkLabel={landmarkLabel}
              />
            ) : null}
            <Box class="flex min-w-0 flex-1 flex-col">
              {((topbar as string) === "inset") ? (
                <ShellTopbar
                  nav={nav}
                  brand={(((sidebar as string) === "none") ? "show" : "hide")}
                  links={(((sidebar as string) === "none") ? "show" : "hide")}
                  search={search}
                  landmarkLabel={landmarkLabel}
                />
              ) : null}
              <ShellContent title={title} titleId={titleId} level={level} content={content} />
              {((footer as string) === "inset") ? (
                <ShellFooter nav={nav} place="inset" landmarkLabel={landmarkLabel} />
              ) : null}
            </Box>
          </Box>
          {((footer as string) === "full") ? (
            <ShellFooter nav={nav} landmarkLabel={landmarkLabel} />
          ) : null}
        </Box>
      </Box>
    </Block>
  );
}
blocks/dashboard-shell.types.ts
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.

import type { NavLink } from "./nav-bar.types";

export type ShellNav = {
  label: string;
  brand: string;
  links: NavLink[];
  current: string;
  subTitle: string;
  sub: NavLink[];
  subCurrent: string;
  search: string;
  shortcut: string;
  expand: string;
  userName: string;
  copyright: string;
  footerLabel: string;
  footer: NavLink[];
};

Solid registry item (JSON)

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework templ --dir src --registry-url https://registry.buildy.tw/templ --strict-cdn
npx ui8kit add dashboard-shell
blocks/dashboard-shell.templ
// Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
// Source: packages/compose-gen/specs/organisms/dashboard-shell.json

package blocks

import (
	"github.com/ui8kit/codegen/generated/templ/ui/box"
	"github.com/ui8kit/codegen/generated/templ/compose"
	uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)

// DashboardShellProps are the props of DashboardShell; the values are the JSON shapes of the TypeScript props.
type DashboardShellProps struct {
	Id any `json:"id"`
	Title any `json:"title"`
	Level any `json:"level"`
	Nav any `json:"nav"`
	Topbar any `json:"topbar"`
	Search any `json:"search"`
	Sidebar any `json:"sidebar"`
	Side any `json:"side"`
	Footer any `json:"footer"`
	Content any `json:"content"`
	Frame any `json:"frame"`
	LandmarkLabel any `json:"landmarkLabel"`
}

// The frame of a signed-in app around placeholder content. Axes: topbar (full: across the whole shell, inset: over the content column only, none), search (show, hide: the search field of the top bar), sidebar (wide, rail, collapsed: the static collapsed state, twolevel: a rail and a section panel, none: the top bar carries the links), side (start, end), footer (full, inset, none), content (grid, split, list), frame (window: a framed window in a section, page: the whole page). Collapsing the sidebar is a port contract.
templ DashboardShell(p DashboardShellProps) {
	{{ vId := p.Id }}
	{{ vTitle := p.Title }}
	{{ vLevel := uiutils.Def(p.Level, float64(2)) }}
	{{ vNav := p.Nav }}
	{{ vTopbar := uiutils.Def(p.Topbar, "full") }}
	{{ vSearch := uiutils.Def(p.Search, "show") }}
	{{ vSidebar := uiutils.Def(p.Sidebar, "wide") }}
	{{ vSide := uiutils.Def(p.Side, "start") }}
	{{ vFooter := uiutils.Def(p.Footer, "none") }}
	{{ vContent := uiutils.Def(p.Content, "grid") }}
	{{ vFrame := uiutils.Def(p.Frame, "window") }}
	{{ vLandmarkLabel := p.LandmarkLabel }}
	{{ vTitleId := any(uiutils.Tpl("{0}-title", vId)) }}
	@compose.Block(compose.BlockProps{BoxProps: box.BoxProps{Tag: "section", Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vFrame, "window")), "bg-background py-12", "bg-background")), Attrs: uiutils.Attrs("id", vId, "aria-labelledby", uiutils.Cond(uiutils.T(vLandmarkLabel), nil, vTitleId), "data-topbar", vTopbar, "data-sidebar", vSidebar, "data-footer", vFooter, "aria-label", vLandmarkLabel, "data-slot", "dashboard-shell")}}) {
		@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vFrame, "window")), "mx-auto w-full max-w-6xl px-4", ""))}}) {
			@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv("flex flex-col overflow-hidden bg-background", uiutils.Cond(uiutils.T(uiutils.Eq(vFrame, "window")), "min-h-160 rounded border border-border", "min-h-screen"))), Attrs: uiutils.Attrs("data-slot", "window")}}) {
				if uiutils.Eq(vTopbar, "full") {
					@ShellTopbar(ShellTopbarProps{Nav: vNav, Links: uiutils.Cond(uiutils.T(uiutils.Eq(vSidebar, "none")), "show", "hide"), Search: vSearch, LandmarkLabel: vLandmarkLabel})
				}
				@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv("flex min-h-0 flex-1", uiutils.Cond(uiutils.T(uiutils.Eq(vSide, "end")), "flex-row-reverse", "")))}}) {
					if !uiutils.Eq(vSidebar, "none") {
						@ShellSidebar(ShellSidebarProps{Nav: vNav, Mode: vSidebar, Side: vSide, Brand: uiutils.Cond(uiutils.T(uiutils.Eq(vTopbar, "full")), "hide", "show"), LandmarkLabel: vLandmarkLabel})
					}
					@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: "flex min-w-0 flex-1 flex-col"}}) {
						if uiutils.Eq(vTopbar, "inset") {
							@ShellTopbar(ShellTopbarProps{Nav: vNav, Brand: uiutils.Cond(uiutils.T(uiutils.Eq(vSidebar, "none")), "show", "hide"), Links: uiutils.Cond(uiutils.T(uiutils.Eq(vSidebar, "none")), "show", "hide"), Search: vSearch, LandmarkLabel: vLandmarkLabel})
						}
						@ShellContent(ShellContentProps{Title: vTitle, TitleId: vTitleId, Level: vLevel, Content: vContent})
						if uiutils.Eq(vFooter, "inset") {
							@ShellFooter(ShellFooterProps{Nav: vNav, Place: "inset", LandmarkLabel: vLandmarkLabel})
						}
					}
				}
				if uiutils.Eq(vFooter, "full") {
					@ShellFooter(ShellFooterProps{Nav: vNav, LandmarkLabel: vLandmarkLabel})
				}
			}
		}
	}
}

templ registry item (JSON)

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework twig --dir src --registry-url https://registry.buildy.tw/twig --strict-cdn
npx ui8kit add dashboard-shell
blocks/dashboard-shell.html.twig
{#- Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
    Source: packages/compose-gen/specs/organisms/dashboard-shell.json
    The frame of a signed-in app around placeholder content. Axes: topbar (full: across the whole shell, inset: over the content column only, none), search (show, hide: the search field of the top bar), sidebar (wide, rail, collapsed: the static collapsed state, twolevel: a rail and a section panel, none: the top bar carries the links), side (start, end), footer (full, inset, none), content (grid, split, list), frame (window: a framed window in a section, page: the whole page). Collapsing the sidebar is a port contract.
    Props (p): id, title, level, nav, topbar, search, sidebar, side, footer, content, frame, landmarkLabel. -#}
{%- set v_id = (p.id ?? null) -%}
{%- set v_title = (p.title ?? null) -%}
{%- set v_level = (p.level ?? 2) -%}
{%- set v_nav = (p.nav ?? null) -%}
{%- set v_topbar = (p.topbar ?? 'full') -%}
{%- set v_search = (p.search ?? 'show') -%}
{%- set v_sidebar = (p.sidebar ?? 'wide') -%}
{%- set v_side = (p.side ?? 'start') -%}
{%- set v_footer = (p.footer ?? 'none') -%}
{%- set v_content = (p.content ?? 'grid') -%}
{%- set v_frame = (p.frame ?? 'window') -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set v_titleId = og_tpl('{0}-title', [v_id]) -%}
{%- set c_5 -%}
  {%- set c_4 -%}
    {%- set c_3 -%}
      {%- if og_t(og_eq(v_topbar, 'full')) %}
        {{ include('blocks/shell-topbar.html.twig', {'p': {'nav': v_nav, 'links': (og_t(og_eq(v_sidebar, 'none')) ? 'show' : 'hide'), 'search': v_search, 'landmarkLabel': v_landmarkLabel}}, with_context = false) }}
      {%- endif %}
      {%- set c_2 -%}
        {%- if og_t(not (og_eq(v_sidebar, 'none'))) %}
          {{ include('blocks/shell-sidebar.html.twig', {'p': {'nav': v_nav, 'mode': v_sidebar, 'side': v_side, 'brand': (og_t(og_eq(v_topbar, 'full')) ? 'hide' : 'show'), 'landmarkLabel': v_landmarkLabel}}, with_context = false) }}
        {%- endif %}
        {%- set c_1 -%}
          {%- if og_t(og_eq(v_topbar, 'inset')) %}
            {{ include('blocks/shell-topbar.html.twig', {'p': {'nav': v_nav, 'brand': (og_t(og_eq(v_sidebar, 'none')) ? 'show' : 'hide'), 'links': (og_t(og_eq(v_sidebar, 'none')) ? 'show' : 'hide'), 'search': v_search, 'landmarkLabel': v_landmarkLabel}}, with_context = false) }}
          {%- endif %}
          {{ include('blocks/shell-content.html.twig', {'p': {'title': v_title, 'titleId': v_titleId, 'level': v_level, 'content': v_content}}, with_context = false) }}
          {%- if og_t(og_eq(v_footer, 'inset')) %}
            {{ include('blocks/shell-footer.html.twig', {'p': {'nav': v_nav, 'place': 'inset', 'landmarkLabel': v_landmarkLabel}}, with_context = false) }}
          {%- endif %}
        {%- endset -%}
        {{ include('compose/Box.html.twig', {'class': 'flex min-w-0 flex-1 flex-col', 'children': c_1}, with_context = false) }}
      {%- endset -%}
      {{ include('compose/Box.html.twig', {'class': og_s(og_cnv(['flex min-h-0 flex-1', (og_t(og_eq(v_side, 'end')) ? 'flex-row-reverse' : '')])), 'children': c_2}, with_context = false) }}
      {%- if og_t(og_eq(v_footer, 'full')) %}
        {{ include('blocks/shell-footer.html.twig', {'p': {'nav': v_nav, 'landmarkLabel': v_landmarkLabel}}, with_context = false) }}
      {%- endif %}
    {%- endset -%}
    {{ include('compose/Box.html.twig', {'class': og_s(og_cnv(['flex flex-col overflow-hidden bg-background', (og_t(og_eq(v_frame, 'window')) ? 'min-h-160 rounded border border-border' : 'min-h-screen')])), 'attrs': og_attrs(['data-slot', 'window']), 'children': c_3}, with_context = false) }}
  {%- endset -%}
  {{ include('compose/Box.html.twig', {'class': og_s((og_t(og_eq(v_frame, 'window')) ? 'mx-auto w-full max-w-6xl px-4' : '')), 'children': c_4}, with_context = false) }}
{%- endset -%}
{{ include('compose/Block.html.twig', {'tag': 'section', 'class': og_s((og_t(og_eq(v_frame, 'window')) ? 'bg-background py-12' : 'bg-background')), 'attrs': og_attrs(['id', v_id, 'aria-labelledby', (og_t(v_landmarkLabel) ? null : v_titleId), 'data-topbar', v_topbar, 'data-sidebar', v_sidebar, 'data-footer', v_footer, 'aria-label', v_landmarkLabel, 'data-slot', 'dashboard-shell']), 'children': c_5}, with_context = false) }}

Twig registry item (JSON)

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework latte --dir src --registry-url https://registry.buildy.tw/latte --strict-cdn
npx ui8kit add dashboard-shell
blocks/dashboard-shell.latte
{* Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
    Source: packages/compose-gen/specs/organisms/dashboard-shell.json
    The frame of a signed-in app around placeholder content. Axes: topbar (full: across the whole shell, inset: over the content column only, none), search (show, hide: the search field of the top bar), sidebar (wide, rail, collapsed: the static collapsed state, twolevel: a rail and a section panel, none: the top bar carries the links), side (start, end), footer (full, inset, none), content (grid, split, list), frame (window: a framed window in a section, page: the whole page). Collapsing the sidebar is a port contract.
    Props (p): id, title, level, nav, topbar, search, sidebar, side, footer, content, frame, landmarkLabel. *}
{var $v_id = ($p['id'] ?? null)}
{var $v_title = ($p['title'] ?? null)}
{var $v_level = ($p['level'] ?? 2)}
{var $v_nav = ($p['nav'] ?? null)}
{var $v_topbar = ($p['topbar'] ?? 'full')}
{var $v_search = ($p['search'] ?? 'show')}
{var $v_sidebar = ($p['sidebar'] ?? 'wide')}
{var $v_side = ($p['side'] ?? 'start')}
{var $v_footer = ($p['footer'] ?? 'none')}
{var $v_content = ($p['content'] ?? 'grid')}
{var $v_frame = ($p['frame'] ?? 'window')}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{var $v_titleId = og_tpl('{0}-title', [$v_id])}
{capture $c_5}
  {capture $c_4}
    {capture $c_3}
      {if og_t(og_eq($v_topbar, 'full'))}
        {=og_include('blocks/shell-topbar.latte', ['p' => ['nav' => $v_nav, 'links' => (og_t(og_eq($v_sidebar, 'none')) ? 'show' : 'hide'), 'search' => $v_search, 'landmarkLabel' => $v_landmarkLabel]])|noescape}
      {/if}
      {capture $c_2}
        {if og_t(!(og_eq($v_sidebar, 'none')))}
          {=og_include('blocks/shell-sidebar.latte', ['p' => ['nav' => $v_nav, 'mode' => $v_sidebar, 'side' => $v_side, 'brand' => (og_t(og_eq($v_topbar, 'full')) ? 'hide' : 'show'), 'landmarkLabel' => $v_landmarkLabel]])|noescape}
        {/if}
        {capture $c_1}
          {if og_t(og_eq($v_topbar, 'inset'))}
            {=og_include('blocks/shell-topbar.latte', ['p' => ['nav' => $v_nav, 'brand' => (og_t(og_eq($v_sidebar, 'none')) ? 'show' : 'hide'), 'links' => (og_t(og_eq($v_sidebar, 'none')) ? 'show' : 'hide'), 'search' => $v_search, 'landmarkLabel' => $v_landmarkLabel]])|noescape}
          {/if}
          {=og_include('blocks/shell-content.latte', ['p' => ['title' => $v_title, 'titleId' => $v_titleId, 'level' => $v_level, 'content' => $v_content]])|noescape}
          {if og_t(og_eq($v_footer, 'inset'))}
            {=og_include('blocks/shell-footer.latte', ['p' => ['nav' => $v_nav, 'place' => 'inset', 'landmarkLabel' => $v_landmarkLabel]])|noescape}
          {/if}
        {/capture}
        {=og_include('compose/Box.latte', ['class' => 'flex min-w-0 flex-1 flex-col', 'children' => (string) $c_1])|noescape}
      {/capture}
      {=og_include('compose/Box.latte', ['class' => og_s(og_cnv(['flex min-h-0 flex-1', (og_t(og_eq($v_side, 'end')) ? 'flex-row-reverse' : '')])), 'children' => (string) $c_2])|noescape}
      {if og_t(og_eq($v_footer, 'full'))}
        {=og_include('blocks/shell-footer.latte', ['p' => ['nav' => $v_nav, 'landmarkLabel' => $v_landmarkLabel]])|noescape}
      {/if}
    {/capture}
    {=og_include('compose/Box.latte', ['class' => og_s(og_cnv(['flex flex-col overflow-hidden bg-background', (og_t(og_eq($v_frame, 'window')) ? 'min-h-160 rounded border border-border' : 'min-h-screen')])), 'attrs' => og_attrs(['data-slot', 'window']), 'children' => (string) $c_3])|noescape}
  {/capture}
  {=og_include('compose/Box.latte', ['class' => og_s((og_t(og_eq($v_frame, 'window')) ? 'mx-auto w-full max-w-6xl px-4' : '')), 'children' => (string) $c_4])|noescape}
{/capture}
{=og_include('compose/Block.latte', ['tag' => 'section', 'class' => og_s((og_t(og_eq($v_frame, 'window')) ? 'bg-background py-12' : 'bg-background')), 'attrs' => og_attrs(['id', $v_id, 'aria-labelledby', (og_t($v_landmarkLabel) ? null : $v_titleId), 'data-topbar', $v_topbar, 'data-sidebar', $v_sidebar, 'data-footer', $v_footer, 'aria-label', $v_landmarkLabel, 'data-slot', 'dashboard-shell']), 'children' => (string) $c_5])|noescape}

Latte registry item (JSON)

Point the CLI at this runtime once, then add the item:

npx ui8kit init --yes --framework jinja2 --dir src --registry-url https://registry.buildy.tw/jinja2 --strict-cdn
npx ui8kit add dashboard-shell
blocks/dashboard-shell.html.j2
{#- Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
    Source: packages/compose-gen/specs/organisms/dashboard-shell.json
    The frame of a signed-in app around placeholder content. Axes: topbar (full: across the whole shell, inset: over the content column only, none), search (show, hide: the search field of the top bar), sidebar (wide, rail, collapsed: the static collapsed state, twolevel: a rail and a section panel, none: the top bar carries the links), side (start, end), footer (full, inset, none), content (grid, split, list), frame (window: a framed window in a section, page: the whole page). Collapsing the sidebar is a port contract.
    Props (p): id, title, level, nav, topbar, search, sidebar, side, footer, content, frame, landmarkLabel. -#}
{%- set v_id = og_def(p['id'], none) -%}
{%- set v_title = og_def(p['title'], none) -%}
{%- set v_level = og_def(p['level'], 2) -%}
{%- set v_nav = og_def(p['nav'], none) -%}
{%- set v_topbar = og_def(p['topbar'], 'full') -%}
{%- set v_search = og_def(p['search'], 'show') -%}
{%- set v_sidebar = og_def(p['sidebar'], 'wide') -%}
{%- set v_side = og_def(p['side'], 'start') -%}
{%- set v_footer = og_def(p['footer'], 'none') -%}
{%- set v_content = og_def(p['content'], 'grid') -%}
{%- set v_frame = og_def(p['frame'], 'window') -%}
{%- set v_landmarkLabel = og_def(p['landmarkLabel'], none) -%}
{%- set v_titleId = og_tpl('{0}-title', [v_id]) -%}
{%- set c_5 -%}
  {%- set c_4 -%}
    {%- set c_3 -%}
      {%- if og_t(og_eq(v_topbar, 'full')) %}
        {{ og_include('blocks/shell-topbar.html.j2', {'p': {'nav': v_nav, 'links': ('show' if og_t(og_eq(v_sidebar, 'none')) else 'hide'), 'search': v_search, 'landmarkLabel': v_landmarkLabel}}) }}
      {%- endif %}
      {%- set c_2 -%}
        {%- if og_t(not (og_eq(v_sidebar, 'none'))) %}
          {{ og_include('blocks/shell-sidebar.html.j2', {'p': {'nav': v_nav, 'mode': v_sidebar, 'side': v_side, 'brand': ('hide' if og_t(og_eq(v_topbar, 'full')) else 'show'), 'landmarkLabel': v_landmarkLabel}}) }}
        {%- endif %}
        {%- set c_1 -%}
          {%- if og_t(og_eq(v_topbar, 'inset')) %}
            {{ og_include('blocks/shell-topbar.html.j2', {'p': {'nav': v_nav, 'brand': ('show' if og_t(og_eq(v_sidebar, 'none')) else 'hide'), 'links': ('show' if og_t(og_eq(v_sidebar, 'none')) else 'hide'), 'search': v_search, 'landmarkLabel': v_landmarkLabel}}) }}
          {%- endif %}
          {{ og_include('blocks/shell-content.html.j2', {'p': {'title': v_title, 'titleId': v_titleId, 'level': v_level, 'content': v_content}}) }}
          {%- if og_t(og_eq(v_footer, 'inset')) %}
            {{ og_include('blocks/shell-footer.html.j2', {'p': {'nav': v_nav, 'place': 'inset', 'landmarkLabel': v_landmarkLabel}}) }}
          {%- endif %}
        {%- endset -%}
        {{ og_include('compose/box.html.j2', {'p': {'Class': 'flex min-w-0 flex-1 flex-col'}, 'children': c_1}) }}
      {%- endset -%}
      {{ og_include('compose/box.html.j2', {'p': {'Class': og_s(og_cnv(['flex min-h-0 flex-1', ('flex-row-reverse' if og_t(og_eq(v_side, 'end')) else '')]))}, 'children': c_2}) }}
      {%- if og_t(og_eq(v_footer, 'full')) %}
        {{ og_include('blocks/shell-footer.html.j2', {'p': {'nav': v_nav, 'landmarkLabel': v_landmarkLabel}}) }}
      {%- endif %}
    {%- endset -%}
    {{ og_include('compose/box.html.j2', {'p': {'Class': og_s(og_cnv(['flex flex-col overflow-hidden bg-background', ('min-h-160 rounded border border-border' if og_t(og_eq(v_frame, 'window')) else 'min-h-screen')])), 'Attrs': og_attrs(['data-slot', 'window'])}, 'children': c_3}) }}
  {%- endset -%}
  {{ og_include('compose/box.html.j2', {'p': {'Class': og_s(('mx-auto w-full max-w-6xl px-4' if og_t(og_eq(v_frame, 'window')) else ''))}, 'children': c_4}) }}
{%- endset -%}
{{ og_include('compose/block.html.j2', {'p': {'Tag': 'section', 'Class': og_s(('bg-background py-12' if og_t(og_eq(v_frame, 'window')) else 'bg-background')), 'Attrs': og_attrs(['id', v_id, 'aria-labelledby', (none if og_t(v_landmarkLabel) else v_titleId), 'data-topbar', v_topbar, 'data-sidebar', v_sidebar, 'data-footer', v_footer, 'aria-label', v_landmarkLabel, 'data-slot', 'dashboard-shell'])}, 'children': c_5}) }}

Jinja2 registry item (JSON)

Props

Names and types come from the xgen specs of the source. Standard HTML attributes (id, role, tabIndex, aria-*) pass through to the root element; the class prop is className in React.

The frame of a signed-in app around placeholder content. Axes: topbar (full: across the whole shell, inset: over the content column only, none), search (show, hide: the search field of the top bar), sidebar (wide, rail, collapsed: the static collapsed state, twolevel: a rail and a section panel, none: the top bar carries the links), side (start, end), footer (full, inset, none), content (grid, split, list), frame (window: a framed window in a section, page: the whole page). Collapsing the sidebar is a port contract.

Props of DashboardShell
PropTypeDefault Description
id (required)string-
title (required)string-
level 1 | 22
nav (required)ShellNav-the brand, the links of both levels and the texts of the shell
topbar "full" | "inset" | "none""full"
search "show" | "hide""show"
sidebar "wide" | "rail" | "collapsed" | "twolevel" | "none""wide"
side "start" | "end""start"
footer "full" | "inset" | "none""none"
content "grid" | "split" | "list""grid"
frame "window" | "page""window"
landmarkLabel string-accessible name of the landmark of this component when the page shows it more than once (a variant); replaces the heading name of the root landmark, follows the name of a nested one

Used in