agentleFS
Hey-DigaHey-Diga/dotclaude/skills/ui-patterns/SKILL.md

ui-patterns

Skill17 starsChanged 9 months agoMITView on GitHub

Dashboard UI templates for page layouts, loading states, error states, and sheet scroll patterns. Use when creating admin dashboard pages or need consistent layout patterns.

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 2 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Import from @/lib/utils/constants.

    line 15
  2. Very specific:

    How to decide: If the page uses <PageFooter>, use WITH_FOOTER.

    line 27
  3. Very specific:

    Use InfoPanel centered with appropriate height class.

    line 62
  4. Distinctive:

    When applying these patterns, explore the codebase for existing implementations:

    line 128
  5. Very specific:

    Search for existing loading states: Glob("src/app//loading.tsx")

    line 130
  6. Very specific:

    Search for existing error states: Glob("src/app//error.tsx")

    line 131
  7. Very specific:

    Search for sheet patterns: Grep("SheetContent", glob="src/components//*.tsx")

    line 132
  8. Very specific:

    Search for PAGE_HEIGHT_CLASS usage: Grep("PAGE_HEIGHT_CLASS", glob="src//*.tsx")

    line 133
  9. Distinctive:

    Use these real implementations as reference alongside the templates above.

    line 135

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Dashboard UI Patterns

Reference templates for building and modifying dashboard pages. Use this when creating new pages, loading states, error states, or sheet/sidebar components.


Page Height Constants

Import from @/lib/utils/constants. These ensure consistent full-viewport layouts across all dashboard pages.

import { PAGE_HEIGHT_CLASS } from "@/lib/utils/constants";
ConstantValueUse When
PAGE_HEIGHT_CLASS.WITH_FOOTER"h-[calc(100dvh-176px)]"Pages WITH footer (customers, FAQs, services, conversations)
PAGE_HEIGHT_CLASS.WITHOUT_FOOTER"h-[calc(100dvh-112px)]"Pages WITHOUT footer (calendar, schedule, settings, pricing)
PAGE_HEIGHT_CLASS.MAX_WITH_FOOTER"max-h-[calc(100dvh-176px)]"Scrollable cards/containers on pages with footer

How to decide: If the page uses <PageFooter>, use WITH_FOOTER. Otherwise use WITHOUT_FOOTER.


Loading State Templates

Page WITH footer

// loading.tsx
<PageContent withFooter>
  <Loader
    className={PAGE_HEIGHT_CLASS.WITH_FOOTER}
    message={t("loading")}
  />
</PageContent>
<PageFooter>&nbsp;</PageFooter>

Page WITHOUT footer

// loading.tsx
<PageContent>
  <Loader
    className={PAGE_HEIGHT_CLASS.WITHOUT_FOOTER}
    message={t("loading")}
  />
</PageContent>

Error State Templates

Use InfoPanel centered with appropriate height class.

// error.tsx pattern
<PageContent
  className={cn(
    PAGE_HEIGHT_CLASS.WITHOUT_FOOTER,
    "flex items-center justify-center"
  )}
>
  <InfoPanel
    title={t("error.loadError")}
    description={error.message || t("error.unexpectedError")}
    icon={<WarningIcon size={40} />}
    iconColor="text-destructive"
  >
    <Button onClick={reset}>{t("error.tryAgain")}</Button>
  </InfoPanel>
</PageContent>

InfoPanel children layout: Children render inline with centered buttons. Multiple buttons appear side-by-side.

<InfoPanel title="..." description="...">
  <Button>Action 1</Button>
  <Button>Action 2</Button>
</InfoPanel>

Sheet / Sidebar Scroll Pattern

For sheets with scrollable content, use this flex layout recipe:

<SheetContent
  side="right"
  className="flex w-full max-h-[100dvh] flex-col gap-0 overflow-hidden sm:max-w-md"
>
  <SheetHeader className="shrink-0 border-b border-border">
    {/* Header content */}
  </SheetHeader>

  <div className="flex min-h-0 flex-1 flex-col overflow-hidden">
    <div className="shrink-0 px-6 py-4 border-b">
      {/* Fixed content (filters, tabs, etc.) */}
    </div>
    <div ref={scrollRef} className="flex-1 overflow-y-auto px-6 py-4">
      {/* Scrollable content */}
    </div>
  </div>
</SheetContent>

Key principles:

  • max-h-[100dvh] and overflow-hidden on SheetContent
  • shrink-0 on fixed elements (headers, footers)
  • min-h-0 flex-1 overflow-hidden on the scrollable wrapper
  • flex-1 overflow-y-auto on the actual scrollable area

Workflow: Finding Real Examples

When applying these patterns, explore the codebase for existing implementations:

  1. Search for existing loading states: Glob("src/app/**/loading.tsx")
  2. Search for existing error states: Glob("src/app/**/error.tsx")
  3. Search for sheet patterns: Grep("SheetContent", glob="src/components/**/*.tsx")
  4. Search for PAGE_HEIGHT_CLASS usage: Grep("PAGE_HEIGHT_CLASS", glob="src/**/*.tsx")

Use these real implementations as reference alongside the templates above.


Icons

Always use Phosphor Icons. lucide-react is banned via linting.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.