Skip to Content
Neshel-UI
Components

@neshel-ui/components

Accessible components, overlays, selection controls, navigation and an application shell.

pnpm add @neshel-ui/config @neshel-ui/components
src/index.css
@import "@neshel-ui/config/tokens.css"; /* or tailwind.css after @import "tailwindcss" */
@import "@neshel-ui/components/styles.css";

Peers: react and react-dom 19, @neshel-ui/config (types). No Tailwind, @source or provider is required. Interactive parts use Radix (dialogs, sheets, popovers, menus, navigation menu, tooltips) and Base UI (Select, MultiSelect, Combobox, Accordion, Collapsible, Switch) internally; you only use Neshel's API.

Catalogue

FamilyComponents
FoundationButton, Card, Badge, Input, Label, Separator, Skeleton, VisuallyHidden
OverlaysDialog, AlertDialog, Sheet, Popover, Tooltip
SelectionSelect, MultiSelect, Combobox (single and multiple)
DisclosureAccordion, Collapsible — not in 0.1.0 yet
Forms and feedbackSwitch, Toast (createToaster and Toaster) — not in 0.1.0 yet
NavigationNavbar, NavigationMenu, DropdownMenu, MobileMenu
ApplicationAppShell, Sidebar (with SidebarTrigger and useAppShell)

Not sure which one to use? See Choosing components.

Conventions

  • Flat names: DialogContent, NavbarBrand (no Dialog.Content), so client references work in React Server Components.
  • asChild: render your element (links, router links) with the component's styles and behaviour — exactly one element child; classes join, styles merge, handlers compose (child first), refs compose.
  • State: stateful components offer value / defaultValue / onValueChange (or open / defaultOpen / onOpenChange).
  • Portals: overlay contents accept container; themes are copied across portals.
  • Responsive props: Button size, AppShell breakpoint, NavbarNav hideBelow, MobileMenu breakpoint accept your configured breakpoint names.
  • Icons: bring your own React nodes (the examples use lucide-react). Icon-only buttons need an aria-label.

Shared types

Responsive

A value, or values per breakpoint that cascade upwards (mobile first).

type Responsive = T | { readonly [K in Breakpoint]?: T; }

Breakpoint

Responsive keys: base (no media query) plus the application's breakpoint names — the defaults sm md lg xl 2xl, or the names configured in neshel.config.ts once the declarations generated by neshel generate are part of the program (ADR 0010).

type Breakpoint = "base" | BreakpointName

FieldSize

Styling size of form fields (uiSize; the native size attribute keeps its HTML meaning).

type FieldSize = "sm" | "md" | "lg"

Errors

Invalid usage throws NeshelComponentsError during render on the server and the client, with a message naming the component and the fix (for example <Button asChild disabled> — links cannot be disabled).

error-boundary-check.tsx
import { NeshelComponentsError } from "@neshel-ui/components";

export function describeError(error: unknown): string {
  return error instanceof NeshelComponentsError ? `Neshel usage error: ${error.message}` : String(error);
}

Styling

Component rules live in the components.neshel cascade layer and read only semantic tokens. Override with tokens (preferred), component custom properties, Tailwind utilities or your own CSS through className. See Theming.

Edit on GitHub

On this page