Skip to main content

UI Components

True Life includes a comprehensive set of shadcn/ui-inspired components built with React. These components are designed for the in-game UI and follow modern web development patterns.

Explore all components with live examples and documentation in our Storybook.

Open Component Gallery →

Available Components

Layout & Structure

ComponentDescription
AccordionExpandable content sections with smooth animations
AspectRatioMaintain consistent aspect ratios for media
CardContainer for grouping related content
CollapsibleToggle visibility of content sections
ScrollAreaCustom scrollbar with consistent styling
SeparatorVisual divider between content sections
TabsOrganize content into tabbed sections

Forms & Inputs

ComponentDescription
ButtonPrimary interactive element with variants
CheckboxBoolean input with label support
DatePickerCalendar-based date selection
LabelAccessible form labels
RadioGroupSingle selection from multiple options
SelectDropdown selection with search
SliderRange input with visual feedback
SwitchToggle between two states
TextInputText entry with validation support

Feedback & Display

ComponentDescription
AlertContextual feedback messages
AlertDialogModal confirmation dialogs
AnimatedNumberSmooth number transitions
AvatarUser profile images with fallback
BadgeStatus indicators and labels
ProgressVisual progress indicators
SkeletonLoading placeholder animations
TooltipContextual information on hover
ComponentDescription
BreadcrumbHierarchical navigation trail
CommandCommand palette with search
ContextMenuRight-click context menus
DropdownMenuExpandable menu options

Overlays

ComponentDescription
DialogModal dialogs for focused interactions
HoverCardRich preview cards on hover
PopoverFloating content containers
SheetSlide-in panels from edges

Utility

ComponentDescription
KbdKeyboard shortcut indicators
TableData tables with sorting and selection

Usage Example

All components are exported from @ui/components/ui:

"use web";
 
import { Button } from "@ui/components/ui/button";
import { Card, CardHeader, CardTitle, CardContent } from "@ui/components/ui/card";
import { Badge } from "@ui/components/ui/badge";
 
export default function MyPanel() {
	return (
		<Card>
			<CardHeader>
				<CardTitle>
					Player Status
					<Badge variant="secondary">Online</Badge>
				</CardTitle>
			</CardHeader>
			<CardContent>
				<Button variant="outline" size="sm">
					View Profile
				</Button>
			</CardContent>
		</Card>
	);
}

Styling

Components use Tailwind CSS with CSS variables for theming. The dark theme is automatically applied in the game UI.

CSS Variables

:root {
	--background: 0 0% 4%;
	--foreground: 0 0% 98%;
	--card: 0 0% 7%;
	--card-foreground: 0 0% 98%;
	--primary: 262.1 83.3% 57.8%;
	--primary-foreground: 0 0% 100%;
	/* ... and more */
}

See the Storybook for complete styling documentation and all component variants.