Skip to content

Base shadcn/ui adapter #5

Closed
Closed

Description

@n4ff4h

Adapter for apps that use shadcn/ui directly (their own copied components). Since shadcn components live in the app, the adapter is created from the app's components: createShadcnAdapter({ Input, Select, Checkbox, … }), with a documented list of the shadcn components it needs, or a shadcn registry item that generates the adapter file. Test it against stock shadcn components.

Activity

  1. added
    next-genNext-gen Javaabu packages
    featurePackage feature from the spec
    on Nov 4, 2026
  2. added a commit that references this issue on Nov 4, 2026
    acd7d02
  3. n4ff4h commented on Nov 4, 2026

    @n4ff4h
    CollaboratorAuthor

    Done on next-gen (acd7d02).

    createShadcnAdapter({ Button, Input, Label, … }) comes from @javaabu/forms/shadcn. Each slot is built only when its shadcn components are passed, and slots without them fall back to plain HTML. That keeps a partial components/ui usable. The docs list which components make which slots, plus the npx shadcn add command: docs/advanced-usage/shadcn.md.

    Testing: stock new-york-v4 components are vendored from the registry in test/shadcn/ui, with only their imports changed. The adapter passes all 19 conformance cases against them, and examples/shadcn.html renders the demo on them.

    Decisions:

    • Factory, not a registry item: I chose the factory over a shadcn registry item. Apps keep their components, and the factory gets fixes on package updates. A registry item can still be added later.
    • Selects: a select without search uses Radix Select. Search, multiple values, tags and server search use the shadcn combobox (Popover + Command), and its values are submitted through hidden inputs.
    • Radios: each radio is its own Radix RadioGroup. The core now syncs radio groups through a registry instead of DOM events, so selecting a Radix button-radio unselects its siblings. The cost is that arrow keys don't move between them. This is documented.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurePackage feature from the specnext-genNext-gen Javaabu packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions