All skills
clerk avatar

/clerk-custom-ui

@1b2b3a1 official
by clerkclerk/skills83 stars
5

Custom authentication flows and component appearance - hooks (useSignIn, useSignUp), themes, colors, fonts, CSS. Use for custom sign-in/sign-up flows, appearance styling, visual customization, branding.

Use this Skill: https://skilld.dev/gh/clerk/skills/clerk-custom-ui

This session only. Nothing lands on disk.

core-3show-component.md

≈825 tokens on demand. Your agent reads this file only when SKILL.md points to it.

<Show> Component

The <Show> component conditionally renders content based on authentication state, roles, permissions, billing plans, and features.

Core 2 ONLY (skip if current SDK): The <Show> component does not exist in Core 2. Use <SignedIn>, <SignedOut>, and <Protect> instead. See migration table below.

Import

import { Show } from '@clerk/nextjs'       // Next.js
import { Show } from '@clerk/react'         // React
import { Show } from '@clerk/react-router'  // React Router
import { Show } from '@clerk/expo'          // Expo

Props

Prop Type Description
when string | object | function Condition for rendering children
fallback? ReactNode Content shown when condition fails
treatPendingAsSignedOut? boolean Treat pending sessions as signed-out (default: true)

when Prop Variants

Authentication State

// Show content only when signed in
<Show when="signed-in">
  <p>Welcome back!</p>
</Show>

// Show content only when signed out
<Show when="signed-out">
  <p>Please sign in.</p>
</Show>

Role Check

<Show when={{ role: 'org:admin' }}>
  <AdminPanel />
</Show>

Permission Check

<Show when={{ permission: 'org:billing:manage' }}>
  <BillingSettings />
</Show>

Billing Feature Check

<Show when={{ feature: 'widgets' }}>
  <WidgetBuilder />
</Show>

Billing Plan Check

<Show when={{ plan: 'gold' }}>
  <PremiumContent />
</Show>

Custom Condition (Function)

<Show when={(has) => has({ role: 'org:admin' }) || has({ permission: 'org:billing:manage' })}>
  <SettingsPanel />
</Show>

Fallback Content

Show alternative content when the condition fails:

<Show when="signed-in" fallback={<p>Please sign in to continue.</p>}>
  <Dashboard />
</Show>

Session Tasks and Pending State

The treatPendingAsSignedOut prop controls how pending sessions (sessions with incomplete tasks) are handled:

// Default: pending sessions are treated as signed-out
<Show when="signed-in" treatPendingAsSignedOut>
  <Dashboard />
</Show>

// Treat pending sessions as signed-in (e.g., to show task completion UI)
<Show when="signed-in" treatPendingAsSignedOut={false}>
  <TaskCompletionFlow />
</Show>

Security Caveat

<Show> only visually hides content — it remains in browser source. It is not a security boundary. For protecting sensitive data, always verify authentication server-side with auth() or use auth.protect() in middleware.

Migration from Core 2

Core 2 Current
<SignedIn> <Show when="signed-in">
<SignedOut> <Show when="signed-out">
<Protect role="org:admin"> <Show when={{ role: 'org:admin' }}>
<Protect permission="org:billing:manage"> <Show when={{ permission: 'org:billing:manage' }}>
<Protect condition={(has) => expr}> <Show when={(has) => expr}>
<Protect fallback={...}> <Show when={...} fallback={...}>
(no equivalent) <Show when={{ feature: 'widgets' }}>
(no equivalent) <Show when={{ plan: 'gold' }}>

Docs

Source: SKILL.md on GitHub

1 warning2d5 checks · Risk SAFE
  • Gen Agent Trust Hub2d

    No security issues were detected. The skill provides legitimate documentation and code examples for implementing custom authentication flows and styling with the Clerk platform.

  • Socket2d

    No alerts

  • Snyk2d

    Risk: MEDIUM · 1 issue

  • Runlayer6mo

    7 files scanned · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 1b2b3a1. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 3 weeks ago
What it can do
Network
metadata
{
  "author": "clerk",
  "version": "2.3.0"
}
All 1 allowed tools
WebFetch
  • React
  • clerk
  • authentication
  • custom-ui
  • hooks
  • theming
  • appearance
  • branding

README badge

README badge for clerk/skills/clerk-custom-ui

Builds custom sign-in and sign-up flows using Clerk's useSignIn and useSignUp hooks, and customizes Clerk component appearance via the appearance prop with themes, colors, fonts, and CSS. Supports both Core 2 and current SDK versions with different API shapes for each.

Generated from the current SKILL.md.

Does this skill work with both Core 2 and the current SDK (v7+)?
Yes. Custom flows have separate references for Core 2 and current SDK because their hook APIs differ. Appearance customization works the same across both, but Core 2 uses `layout` instead of `options` and imports themes from `@clerk/themes` instead of `@clerk/ui/themes`.
Can I use the shadcn theme with Clerk components?
Yes. If your project has `components.json` (shadcn/ui installed), import the shadcn theme from `@clerk/ui/themes` and apply it as your first customization step to ensure visual consistency with your design system.
How do I build a completely custom sign-in form?
Use the `useSignIn` hook with a custom component. The skill includes separate references for Core 2 and current SDK since their APIs differ significantly.
What's the difference between `variables` and `options` in the appearance prop?
`variables` controls colors, typography, and spacing (e.g. `colorPrimary`, `borderRadius`). `options` controls component structure like logo URL and social button layout (note: Core 2 calls this `layout`).
Does this skill require ClerkProvider to be set up first?
Yes. The skill assumes `ClerkProvider` wraps your app. Refer to the `clerk-setup` skill for initial installation if needed.

Generated from the current SKILL.md. These answers refresh after source changes.