Index of every page on this site: llms.txt
All skills
appica-dev avatar

/appica-ui-react

@7b91029
by Appicaappica-dev/appica-ui504 stars
33
Run it yourself

Builds React interfaces with the Appica UI component library (@appica/ui-react). Finds the right component among its 75+, composes it without the mistakes that type-check but fail silently, styles with role-based design tokens, and verifies the Tailwind CSS v4 setup with a bundled check script. Use whenever a project depends on @appica/ui-react or the user mentions Appica UI, for any interface work there, such as building or changing a page, form, dialog, drawer, menu, table or navigation, theming and brand colors, dark mode, or right-to-left support, and for installing or upgrading the library or fixing components that render unstyled. Applies even when the request names no component, such as "add a filter drawer", "make this a modal" or "brand this in purple".

Use this Skill: https://skilld.dev/gh/appica-dev/appica-ui/appica-ui-react

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencescomposition.md

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

Composition

How to make a component render as something else, make a link look like a button, and reach the elements around a popup. Full text: https://appica.dev/ui/docs/react/composition.md.

Contents

The render prop

Most components take render. Pass an element and the component adopts it as its output, merging in its own props, classes and handlers. It changes the element and keeps the component's role.

<NavigationLink render={<Link href="/pricing" />}>Pricing</NavigationLink>
<Badge render={<a href="/tags/react" />}>React</Badge>
<TooltipTrigger render={<Button variant="outline">Hover me</Button>} />

A trigger (DialogTrigger, DropdownMenuTrigger, PopoverTrigger, TooltipTrigger) renders its own <button>. To make a Button the trigger, pass it through render as above. Nesting it as a child puts a button inside a button.

A menu item that navigates is a *LinkItem (DropdownMenuLinkItem, ContextMenuLinkItem, MenubarLinkItem) with the router link in render. A link item does not close the menu when clicked, which shows with client-side routing: the page changes and the menu stays open. Pass closeOnClick.

<DropdownMenuLinkItem closeOnClick render={<Link href="/settings" />}>
  Settings
</DropdownMenuLinkItem>

A link that looks like a button

Button enforces button semantics, so <Button render={<a />}> produces a link that assistive technology announces as a button. Leave the link a link and give it the button's classes:

import { buttonVariants } from '@appica/ui-react/button'

<Link href="/pricing" className={buttonVariants({ variant: 'outline', size: 'md' })}>
  View pricing
</Link>
Helper Import from Takes
buttonVariants @appica/ui-react/button variant, size
inputVariants @appica/ui-react/input variant, size, state
navigationLinkVariants @appica/ui-react/navigation variant, size

nativeButton={false} with render is for drawing a Button on a non-interactive element, a <div> or a <span>. It is not a way to render a link.

Where className goes

On a component composed with render:

  • Visual overrides (className, style) go on the wrapper.
  • Structural props (href, type, variant, size) go on the element inside render.
// Right: the class is on the wrapper
<TooltipTrigger className="rounded-full" render={<Button variant="ghost">Help</Button>} />

// Wrong: the class is on the element passed to render
<TooltipTrigger render={<Button variant="ghost" className="rounded-full">Help</Button>} />

In a Server Component the inner element is built on the server, serialized, then cloned on the client, and the 2 class strings can disagree: a hydration mismatch. The wrapper's classes are merged last, so they still win. If a class has to sit on the inner element, extract the trigger into a 'use client' component of its own.

Any className is merged with tailwind-merge: a conflicting utility replaces the component's, with no !important and no specificity to fight.

<Button className="w-full rounded-full">Continue</Button>

Prefer a variant to recoloring. Buttons, badges and menu items paint their hover and pressed fill on a ::before layer, so a recolor has to target it too: hover:before:bg-background-muted, not hover:bg-*.

Server Components

Interactive components carry their own 'use client' boundary, so they import straight into a Server Component:

import { Button } from '@appica/ui-react/button'

export default function Page() {
  return <Button>Works in a Server Component</Button>
}

What cannot cross the boundary is a non-serializable prop: a function such as onClick, a function child, or render={<YourClientComponent />}. Move that piece into a small 'use client' component of your own and keep the page a Server Component. Providers are client components too, and sit fine inside the root layout's <body>.

The elements around a popup

A popup is more than the box you see. Floating components render a portal, a positioner and the popup. Modal components render a portal, a backdrop, a viewport and the popup. *Content is the popup, so its className, style and render land there. The rest are reached through props on *Content:

Prop Reaches On
positionerProps the element that positions the popup floating components
portalProps the portal floating and modal components
backdropProps the dimmed layer behind a modal Dialog, AlertDialog, Drawer
viewportProps the fixed layer that centers the popup Dialog, AlertDialog, Drawer
<PopoverContent positionerProps={{ className: 'z-100' }}>...</PopoverContent>
<DialogContent backdropProps={{ className: 'bg-black/60' }}>...</DialogContent>

A className passed this way is merged with the component's own. Positioning needs none of this: side, align, sideOffset, alignOffset, anchor and the collision props are flat props on *Content.

Because the popup is portaled to <body>, nothing set on an ancestor of the trigger reaches it through CSS. A dark class goes on the positioner or the viewport (see theming.md), and so does a dir for a right-to-left region (see accessibility-and-rtl.md). React context is not affected: it crosses a portal.

The container prop

container moves the portal: it takes an element, a ShadowRoot, or a ref to either. Use it for shadow DOM, an iframe, or a stacking context you own on purpose.

Do not use it to theme a popup or to "keep it inside" a panel. The panel's overflow: hidden clips the popup again, and z-50 competes inside the panel's stacking context. For Dialog, AlertDialog and Drawer it is worse: their backdrop and viewport are position: fixed, and any ancestor with transform, filter, backdrop-filter, contain or will-change becomes their containing block, so the full-screen overlay collapses to that ancestor's box.

Types

Derive a variant or size union from the component. The internal unions are not exported:

import type { ComponentProps } from 'react'
import { Button } from '@appica/ui-react/button'

type ButtonVariant = ComponentProps<typeof Button>['variant']

ref is a plain prop on every component (React 19), so a wrapper of your own needs no forwardRef.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts1d3 checks · Risk SAFE
  • Gen Agent Trust Hub1d

    This skill provides a secure environment for building React 19 interfaces with the Appica UI library. It includes detailed usage documentation and a local Node.js script for static analysis of project files to ensure compliance with Tailwind CSS v4 and library-specific rules. No malicious patterns or security risks were identified.

  • Socket1d

    No alerts

  • Snyk1d

    Risk: LOW · No issues

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

Last checked against GitHub 3 days ago.

Activeupdated 3 days ago
compatibility
For React 19 projects. The bundled check script needs Node.js 18 or later.
metadata
{
  "author": "appica",
  "version": "1.5.0"
}

README badge

README badge for appica-dev/appica-ui/appica-ui-react