Unkey
ComponentsDialogs

NavigableDialog

Features

  • Multi-step navigation with sidebar
  • Icon support for navigation items
  • Accessible modal implementation
  • State management between steps
  • Customizable styling for each section
  • Keyboard navigation support
  • Responsive design

Structure

The NavigableDialog is composed of several components that work together:

  1. NavigableDialogRoot - The container component that manages dialog state
  2. NavigableDialogHeader - Contains the title and optional subtitle
  3. NavigableDialogBody - Wrapper for navigation and content
  4. NavigableDialogNav - Sidebar navigation with icons and labels
  5. NavigableDialogContent - The main content area that displays the active section
  6. NavigableDialogFooter - Optional section for actions like buttons

Styling

The component includes default styling with:

  • Responsive layout with side navigation
  • Smooth transitions between sections
  • Icon support in navigation items
  • Dark mode support
  • Customizable through className props

Usage

<NavigableDialogRoot isOpen={isOpen} onOpenChange={setIsOpen}>
  <NavigableDialogHeader
    title="Example Dialog"
    subTitle="Optional subtitle text"
  />
  
  <NavigableDialogBody>
    <NavigableDialogNav
      items={[
        { id: "general", label: "General", icon: Book2 },
        { id: "security", label: "Security", icon: Key },
      ]}
    />
    <NavigableDialogContent
      items={[
        {
          id: "general",
          content: <div>General settings content</div>
        },
        {
          id: "security",
          content: <div>Security settings content</div>
        },
      ]}
    />
  </NavigableDialogBody>
 
  <NavigableDialogFooter>
    <Button>Save Changes</Button>
  </NavigableDialogFooter>
</NavigableDialogRoot>

Basic Example

Component Props

PropTypeDefaultDescription
isOpenboolean-Controls the open state of the dialog
onOpenChange(value: boolean) => void-Callback when the open state changes
dialogClassNamestring-Additional classes for the dialog container
preventAutoFocusbooleantrueWhether to prevent auto-focus on open
childrenReactNode-The content to display in the dialog
PropTypeDefaultDescription
items{ id: string; label: ReactNode; icon?: FC }[]-Navigation items configuration
classNamestring-Additional classes for the navigation
onNavigate(fromId: string) => boolean | Promise<boolean>-Optional navigation validation
initialSelectedIdstring-Initial active section ID
disabledIdsstring[]-IDs of disabled navigation items
PropTypeDefaultDescription
items{ id: string; content: ReactNode }[]-Content items for each section
classNamestring-Additional classes for content area
PropTypeDefaultDescription
titlestring-The title of the dialog
subTitlestring-Optional subtitle for the dialog

Accessibility

The NavigableDialog implements the following accessibility features:

  • Full keyboard navigation support
  • ARIA labels for navigation items
  • Focus management between sections
  • Screen reader announcements for section changes
  • All the accessibility features from the base Dialog component

On this page