Zum Inhalt springen

shadcn Release Notes

Einträge
52
Quellen
2
Zuletzt aktualisiert

Folge shadcn, um die Release Notes in deinen Feed zu holen.

UI von shadcn

@shadcn/react@0.2.1: Fehlerbehebungen im MessageScroller

@shadcn/react@0.2.1 behebt mehrere Fehler im MessageScroller, darunter das Scrollverhalten bei autoScroll und scrollAnchor während gestreamter Antworten, ein flackerndes Scroll-Button-Verhalten sowie die ResizeObserver-Fehlermeldung „loop completed with undelivered notifications“.

Patch Changes

  • #11106 f6a26478547c7057aeda82516666dc3473dc39bd Thanks @shadcn! - Fix MessageScroller autoScroll around anchored turns: the anchor hold now hands off to follow-output once the streamed reply fills the viewport, content growth outrunning the frame-coalesced resize handler no longer releases follow-output, and the scroll button no longer flickers while follow-output closes the gap a streamed chunk just opened.

  • #11100 dd6ce77cf1606eee2839368a97cc35417f763232 Thanks @shadcn! - Fix MessageScroller abandoning a newly appended scrollAnchor placement when autoScroll is enabled, so the anchored turn holds at the reading line while the reply streams.

  • #11085 628e427231ca4bb7f586a69f99fe7809749a53e2 Thanks @devnomic! - Fix MessageScroller firing "ResizeObserver loop completed with undelivered notifications" during streamed content growth by coalescing ResizeObserver callbacks into requestAnimationFrame.

Originalquelle(öffnet in neuem Tab)Problem melden

UI von shadcn

shadcn 4.11.1: Native Fetch und Abhängigkeits-Erhalt

shadcn@4.11.1 ersetzt node-fetch durch native fetch und bewahrt bestehende Versionsangaben in package.json bei shadcn add.

Patch Changes

Originalquelle(öffnet in neuem Tab)Problem melden

shadcn

Alle shadcn-Komponenten importieren cn aus dem Paket cn

Registry-Komponenten, Blocks und Beispiele importieren cn jetzt aus dem neuen Paket cn statt aus @/lib/utils, npx shadcn init installiert es und bestehende Projekte funktionieren weiter, optional lässt sich mit pnpm dlx shadcn@latest migrate cn migrieren.

Every shadcn component now imports cn from the cn package.

For years, every shadcn project started with the same five lines in lib/utils.ts: import clsx, import twMerge, wrap one in the other, export it as cn. It worked, but it meant two dependencies and a helper you had to copy into every project and every registry.

We have moved that into a package. cn is a drop-in replacement for twMerge(clsx(...)). It is smaller, faster and ships the same API, so nothing changes at the call site.

import { cn } from "cn"
 
;<div className={cn("flex items-center", className)} />

What changed

  • Registry components, blocks and examples import cn from cn instead of @/lib/utils.
  • npx shadcn init installs cn and generates a one-line lib/utils.ts.
  • Every registry item that uses cn declares it as a dependency, so npx shadcn add installs it in projects created before this change.

lib/utils.ts

The utils registry item still exists. It now re-exports cn so your own code keeps working and you still have a single place for project helpers.

lib/utils.ts

export { cn } from "cn"

Existing projects

Nothing breaks. Your lib/utils.ts keeps working and new components install cn next to it. To move the rest of your project over and drop clsx and tailwind-merge, run the migration:

pnpm dlx shadcn@latest migrate cn
``` …

Originalquelle(öffnet in neuem Tab)Problem melden

shadcn

GitHub-Registries unterstützen jetzt private Repositories

Die CLI kann nun aus privaten GitHub-Repositories installieren, die der Nutzer lesen kann, entweder über die Anmeldedaten der GitHub CLI oder in CI über GH_TOKEN bzw. GITHUB_TOKEN.

GitHub registries now work with private repositories.

In June, we made it possible to turn any public GitHub repository into a registry. Teams asked for the same thing for their internal code: design systems, feature kits, agent rules and conventions that should not be public.

You can now install from private repositories. If you can read the repository, the CLI can install from it.

pnpm dlx shadcn@latest add acme/internal-toolkit/auth-kit

Zero configuration

If you are logged in to the GitHub CLI, there is nothing to set up.

gh auth login

When a repository is not publicly readable, the CLI reads it through gh using your stored credentials. The token stays inside the GitHub CLI. It never enters the shadcn process.

✔ Using gh credentials.
✔ Checking registry.
✔ Created 1 file:
  - lib/auth.ts

CI support

Where the GitHub CLI is not installed, set GH_TOKEN or GITHUB_TOKEN:

GH_TOKEN=github_pat_xxx npx shadcn@latest add acme/internal-toolkit/auth-kit

We recommend a fine-grained personal access token scoped to the repository with Contents: Read-only access.

Works with every command

Private repositories work with the same commands as public GitHub registries.

pnpm dlx shadcn@latest list acme/internal-toolkit
pnpm dlx shadcn@latest search acme/internal-toolkit --query auth

Originalquelle(öffnet in neuem Tab)Problem melden

shadcn

@shadcn/helpers: Human-in-the-Loop-Abläufe für das AI SDK mocken

@shadcn/helpers kann nun Human-in-the-Loop-Abläufe für das AI SDK simulieren, bei denen eine skriptgesteuerte Konversation auf Nutzereingaben oder eine Freigabe (needsApproval) wartet und danach fortfährt.

@shadcn/helpers can now mock human-in-the-loop flows for the AI SDK. A scripted conversation can pause for real user input, wait for an approval, and continue with whatever the user decided.

Everything streams through the real useChat lifecycle, so your tool cards, approval prompts, and question flows behave exactly as they would in production.

import { createChat } from "@shadcn/helpers/ai-sdk"
 
const chat = createChat<ChatMessage>()
  .user("Help me plan the next prototype.")
  .assistant(({ writer }) => {
    writer.text("A couple of questions before I start.")
    writer.tool("askQuestions", { input: { questions } })
  })
  .assistant(({ writer, toolCall }) => {
    writer.text(
      toolCall?.name === "askQuestions" && toolCall.output
        ? `Starting with ${toolCall.output.answers.direction}.`
        : "Starting now."
    )
  })

Pass needsApproval to pause behind the user's decision. The scripted output streams after approval, and denial streams automatically.

chat
  .assistant(({ writer }) => {
    writer.text("That will archive 3 drafts. I need your approval.")
    writer.tool("archiveDrafts", {
      input: { count: 3 },
      needsApproval: true,
      output: { archived: 3 },
    })
  })
  .assistant(({ writer, toolCall }) => {
    writer.text(
      toolCall?.approved ? "Archived 3 drafts." : "Okay, leaving them in place."
    )
  })

[

Read the Docs

](/docs/helpers/ai-sdk#human-in-the-loop)

Originalquelle(öffnet in neuem Tab)Problem melden

UI von shadcn

Neue Komponente Questionnaire für mehrstufige Fragenabläufe

Mit Questionnaire erscheint eine neue Komponente für mehrstufige Fragenabläufe wie Onboarding, Umfragen oder Agent-Rückfragen, verfügbar für Base UI, React Aria und Radix in allen acht Styles sowie als unstyled Primitive in @shadcn/react.

Today, we're releasing Questionnaire, a new component for multi-step question flows. Use it for agent clarification prompts, onboarding, surveys, intake forms, and configuration.

Questionnaire is available for Base UI, React Aria, and Radix across all eight styles.

"use client"

import * as React from "react"

Features

  • Single and multiple selection with native radios and checkboxes.
  • Freeform answers alongside fixed choices.
  • Explicit skipping for optional questions.
  • Previous, next, submit, and custom progress controls.
  • Required and custom validation.
  • Controlled navigation, saved defaults, and conditional questions.
  • Keyboard navigation with optional letter or number shortcuts.
  • Native form serialization and server-rendered collection state.
  • Standalone, Card, and Dialog composition.

Installation

pnpm dlx shadcn@latest add questionnaire

@shadcn/react

The <Questionnaire /> component is also available as an unstyled headless primitive in @shadcn/react. Read the docs to learn more.

[

View Questionnaire

](/docs/components/base/questionnaire)

Originalquelle(öffnet in neuem Tab)Problem melden

shadcn

Registries können die Suche jetzt serverseitig abwickeln

Bei shadcn search leitet die CLI die Suchparameter als Query-Parameter an die Registry weiter und übernimmt deren Ergebnisse samt pagination-Objekt unverändert, was die Suche in großen Registries beschleunigt; statische Registries funktionieren unverändert weiter.

Registries can now handle search server-side.

When you run shadcn search, the CLI forwards the search parameters to your registry as query params:

GET /r/registry.json?q=button&limit=50&offset=0

Return the matching items with a pagination object and the CLI uses your results as-is. This makes search fast for large registries: no more downloading the full catalog to search it.

registry.json?q=button&limit=1

{
  "name": "acme",
  "homepage": "https://acme.com",
  "items": [
    {
      "name": "button",
      "type": "registry:ui",
      "description": "A button component."
    }
  ],
  "pagination": {
    "total": 12,
    "offset": 0,
    "limit": 1,
    "hasMore": true
  }
}

Dynamic search is opt-in. Static registries ignore the query params and keep working without any changes.

See the Dynamic Search docs for the full guide.

More Updates …

Originalquelle(öffnet in neuem Tab)Problem melden