Overview
Nightwatch UI is Skiff’s design system implementation - a modern, accessible component library built with React, styled-components, and Material UI. It provides a complete set of UI primitives for building consistent user interfaces across the Skiff platform. The library features dual light/dark theming, responsive design patterns, and comprehensive TypeScript support.Installation
Import Styles
Basic Usage
Core Components
Button
The Button component comes in multiple variants for different use cases.- With Loading
Button Props
Button text content
Click event handler
Button variant:
PRIMARY, SECONDARY, TERTIARY, DESTRUCTIVEButton size:
X_SMALL, SMALL, MEDIUM, LARGEOptional start icon
Shows loading spinner
Disables button interaction
Expands button to full container width
Tooltip text on hover
Force light or dark theme
Dialog
Modal dialogs for user interactions and confirmations.- Confirm Dialog
- Input Dialog
Dialog Props
Dialog visibility state
Close handler
Dialog action buttons or custom content
Dialog variant:
CONFIRM, DEFAULT, INPUT, PROMOTIONAL, SEARCH, SETTINGS, LANDSCAPEDialog title text
Dialog description text
Input fields for the dialog
Shows loading spinner
Hides the close (X) button
Prevents closing on outside click
InputField
Flexible input component with support for icons, validation, and various styles.- Basic Input
- With Icon
- With Validation
InputField Props
Input value
Change event handler
Placeholder text
Input type:
DEFAULT, EMAIL, PASSWORD, NUMBER, TEL, URLStart icon
End icon or custom element
Error state or error message
Helper text below input
Disables input
Makes input read-only
Style variant:
DEFAULT, GHOSTInput size
Dropdown
Contextual menus with keyboard navigation support.Dropdown Props
Dropdown visibility state
Update dropdown state
Reference to anchor element
Render in portal (recommended for better positioning)
Match anchor width
Search input at top of dropdown
Maximum dropdown height
Tabs
Tabbed navigation component with smooth animations.Toast
Toast notifications for temporary messages.Toggle
Toggle switch component.Complete Component List
Nightwatch UI includes the following components:- Button Components:
Button,IconButton,ButtonGroup,ButtonGroupItem - Input Components:
InputField,TextArea,Select,CodeInput - Display Components:
Avatar,Chip,MonoTag,Typography,Skeleton,Facepile - Feedback Components:
Dialog,Toast,CircularProgress,Banner - Navigation Components:
Tabs,Dropdown,DropdownItem,DropdownSubmenu - Overlay Components:
Tooltip,Surface,Portal - Layout Components:
Divider - Form Components:
Toggle - Icon System:
Iconswith 100+ icons
Theming
Nightwatch UI uses CSS custom properties for theming, with full light and dark mode support.Using Themes
Theme Variables
The theme system provides semantic color tokens:- Text:
--text-primary,--text-secondary,--text-tertiary,--text-disabled,--text-link,--text-destructive - Icons:
--icon-primary,--icon-secondary,--icon-disabled - Backgrounds:
--bg-l0-solid,--bg-l1-solid,--bg-l2-solid,--bg-l3-solid - Borders:
--border-primary,--border-secondary,--border-hover,--border-active - Accents:
--accent-orange-primary,--accent-green-primary,--accent-blue-primary, etc.
Custom Styling
Components support styled-components and custom className props:Typography System
Icon System
Size System
Consistent sizing across all components:Type System
Button and component variants:Accessibility
All components follow accessibility best practices:- Proper ARIA attributes
- Keyboard navigation support
- Focus management
- Screen reader compatibility
- Color contrast compliance
Best Practices
Use semantic component types
Use semantic component types
Use
Type.DESTRUCTIVE for delete actions, Type.PRIMARY for main CTAs, and Type.SECONDARY for alternative actions.Leverage the theming system
Leverage the theming system
Use
forceTheme sparingly - let components inherit theme from context when possible.Consistent sizing
Consistent sizing
Stick to the standard
Size enum values for visual consistency across your application.Keyboard navigation
Keyboard navigation
TypeScript Support
Nightwatch UI is fully typed with TypeScript. Import types directly:Dependencies
Core dependencies:react^17.0.2react-dom^17.0.2styled-components^5.3.3@mui/material^5.10.0framer-motion^6.3.3@floating-ui/react-dom^1.0.1
libs/nightwatch-ui/package.json:40 for the complete dependency list.