Components

Components

60 accessible React components

All components are imported flat from @hareru/ui:

import { Button, Card, Dialog, toast } from "@hareru/ui"

This is a guide to the main components. For the full public API including subcomponents, variant functions, and type exports, see src/index.ts on GitHub.

Component Patterns

A. Standalone Components

Basic elements that operate with props alone.

ComponentPrimary Use
ButtonButton with variant and size props
BadgeStatus label
InputText input
TextareaMulti-line text input
LabelForm label
SeparatorDivider line
SkeletonLoading placeholder
CheckboxCheckbox control
SwitchToggle switch
ProgressProgress bar
ToggleToggle button
AsyncComboboxFieldCombobox with debounced async search

B. Composite Components

Used by combining multiple sub-components.

ComponentSub-components
CardCardHeader, CardTitle, CardDescription, CardContent, CardFooter
AlertAlertTitle, AlertDescription
EmptyStateEmptyStateIcon, EmptyStateTitle, EmptyStateDescription, EmptyStateAction
FormFieldFormFieldLabel, FormFieldGroupLabel, FormFieldControl, FormFieldDescription, FormFieldMessage
RadioGroupRadioGroupItem, RadioGroupItemIndicator
TabsTabsList, TabsTrigger, TabsContent
BentoGridBentoGridItem
BreadcrumbBreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis
PaginationPaginationContent, PaginationItem, PaginationLink, PaginationPrevious, PaginationNext, PaginationEllipsis
ToggleGroupToggleGroupItem
ToolbarToolbarButton, ToolbarGroup, ToolbarSeparator, ToolbarLink
CheckboxGroup(uses existing Checkbox as children)

C. Base UI Overlay Components

Overlay components wrapping Base UI primitives.

ComponentSub-components
DialogDialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, DialogClose
AlertDialogAlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel
SheetSheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription
SelectSelectTrigger, SelectValue, SelectContent, SelectItem
DropdownMenuDropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, ...
PopoverPopoverTrigger, PopoverContent
TooltipTooltipProvider, TooltipTrigger, TooltipContent
PreviewCardPreviewCardTrigger, PreviewCardContent
ContextMenuContextMenuTrigger, ContextMenuContent, ContextMenuItem, ...
ComboboxComboboxTrigger, ComboboxContent, ComboboxInput, ComboboxList, ComboboxItem
CommandCommandInput, CommandList, CommandGroup, CommandItem, CommandDialog
NavigationMenuNavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent
AccordionAccordionItem, AccordionHeader, AccordionTrigger, AccordionContent
CollapsibleCollapsibleTrigger, CollapsibleContent
ScrollAreaScrollBar
SliderSliderTrack, SliderRange, SliderThumb, SliderOutput

D. Global Services

ComponentUse
ToastToast notifications via toast() function
AvatarAvatarImage, AvatarFallback

E. Data Display

ComponentUse
TableData table with TableHeader, TableBody, TableRow, TableHead, TableCell
ReadonlyFieldNon-editable field display
KeyValueListKey-value pair list for metadata
FieldDiffSide-by-side field comparison

F. AI / Chat

ComponentUse
ChatContainerChat UI wrapper with header, messages, footer
ChatMessageIndividual message bubble with role variants
ChatComposerMessage input with send button
StreamingTextAnimated streaming text display
ToolCallCardTool invocation status display
ApprovalCardHuman-in-the-loop approval card
ReasoningPanelAI reasoning step display

G. DI Domain

ComponentUse
MetricCardMetric value display with freshness indicator
ConfidenceBadgeConfidence level badge
DefinitionBrowserTabbed browser for semantic models, metrics, dimensions
DataQualityIndicatorQuality dimension scores with alert display
QueryFeedbackUser feedback collector for query results
SemanticSuggestSemantic suggestion list with evidence

H. Hooks

HookUse
useAGUIStateAG-UI protocol state manager with JSON Patch support
useThemeTheme state and switching (light, dark, system)
useToastToast state management

On this page