Skip to Content
Neshel-UI
Guides

Choosing components

Dialog or AlertDialog, Dialog or Sheet, NavigationMenu or DropdownMenu, Select, MultiSelect or Combobox, and more.

Dialog vs AlertDialog

DialogAlertDialog
PurposeAny modal task: forms, details, settingsAn interruption that needs an explicit decision (destructive confirmation)
Roledialogalertdialog
Outside pressClosesIgnored
Initial focusFirst focusable elementCancel
EscapeClosesCancels

Use AlertDialog sparingly; prefer undo over confirmation when possible.

Dialog vs Sheet

Both are modal dialogs with the same focus management. A Sheet slides from an edge (side: left, right, top, bottom) and suits secondary content tied to the current page — filters, details, navigation drawers. A Dialog is centred and suits self-contained tasks. Sheet was called "Drawer" in earlier proposals; there is no separate Drawer component.

NavigationMenuDropdownMenu
ContainsLinks to pagesCommands (actions, toggles, radio choices)
Semantics<nav> with lists and disclosure panelsmenu / menuitem roles
Typical placeSite headerAccount menu, row actions, toolbars

Do not put navigation links in a DropdownMenu only because it looks right: screen readers announce a menu of commands.

Select vs Combobox

SelectCombobox
InputA button that opens a listboxA text input that filters a listbox
Best forShort lists (up to ~15 options)Long lists, search, server results
TypeaheadJump by first lettersFree typing filters items
ValueAlways one of the optionsAlways one of the items (no free text)

For free text with suggestions, use a native <Input list="…"> with a <datalist>.

Select vs MultiSelect

MultiSelect is the multiple-value counterpart of Select: removable chips beside the trigger (never inside it), a clear-all button, and announcements when values are removed. For searchable multiple selection use Combobox with multiple.

Controlled vs uncontrolled inputs

Uncontrolled (defaultValue) is simpler and works with native forms; controlled (value + onValueChange) lets your state drive the UI. Don't switch a component between the two during its lifetime. See Forms.

Desktop vs mobile navigation

  • Navbar + NavbarNav + MobileMenu: a top bar whose links collapse into a sheet below a breakpoint. NavbarNav hideBelow="md" with MobileMenu breakpoint="md" guarantees exactly one is visible.
  • AppShell + Sidebar: application navigation. Desktop shows a sidebar (expanded or icon rail); below the shell's breakpoint the same sidebar content moves into a modal drawer.

Full vs collapsed Sidebar

collapsible="icon" (default) collapses to an icon rail on desktop: labels stay as accessible names and appear as tooltips on hover and focus. collapsible="offcanvas" hides the sidebar completely when collapsed. collapsible="none" keeps it expanded. On mobile, the sidebar is always a drawer.

Accordion vs Collapsible

AccordionCollapsible
SectionsSeveral related onesOne
TriggerA heading that contains a buttonA button
KeyboardArrow keys, Home and End between headersEnter and Space
Statevalue (string or list)open (boolean)

Switch vs checkbox

A Switch takes effect immediately. A checkbox is a choice that waits for a submit button, or one of several that can be selected together; use the native <input type="checkbox">.

Toast vs Dialog vs inline message

ToastAlertDialogInline message
Use forConfirming something that already happenedA decision before continuingErrors about a field or the page
InterruptsNoYesNo
Disappears by itselfUsuallyNoNo

Never put the only copy of important information in a toast.

Edit on GitHub

On this page