A modern Flutter UI package with beautiful, customizable components designed for clean and consistent user interfaces.
- π¨ Modern Design - Clean, minimal design language
- π Dark Mode Support - Built-in light and dark theme support
- π Data Visualization - Beautiful animated charts for data presentation
- π± Responsive - Components adapt to different screen sizes
- π― Customizable - Extensive customization options
- π Easy to Use - Simple, intuitive API
HuxButton
- Customizable button with multiple variants (primary, secondary, outline, ghost)- Multiple sizes (small, medium, large)
- Loading states and icon support
HuxCard
- Flexible card component with optional header, title, and actions- Customizable padding, margin, and border radius
- Tap handling support
HuxTextField
- Enhanced text input with consistent styling
HuxCheckbox
- Interactive checkbox with custom styling and labels- Label, helper text, and error state support
- Multiple sizes and validation
HuxLoading
- Customizable loading indicatorsHuxLoadingOverlay
- Full-screen loading overlay
HuxChart
- Beautiful data visualization with line and bar charts
HuxContextMenu
- Right-click context menus with smart positioningHuxContextMenuItem
- Individual menu items with icons and statesHuxContextMenuDivider
- Visual separators for menu groups- Cross-platform support with proper web context menu handling
Right-click the example app components to see context menus in action!
HuxSwitch
- Toggle switch with smooth animations between on/off states
HuxBadge
- Status indicators and notification counters with semantic variants
HuxAlert
- Message boxes with variants (info, success, error) and dismissible functionality
HuxAvatar
- Circular user images with initials fallback, custom colors, and beautiful gradient variantsHuxAvatarGroup
- Display multiple avatars with overlapping or spaced layouts
HuxTheme
- Pre-configured light and dark themesHuxColors
- Comprehensive color palette
π Complete Documentation - Visit our comprehensive documentation site for detailed guides, API references, and examples.
flutter pub add hux
Wrap your app with the Hux theme:
import 'package:flutter/material.dart';
import 'package:hux/hux.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Hux UI Demo',
theme: HuxTheme.lightTheme,
darkTheme: HuxTheme.darkTheme,
home: MyHomePage(),
);
}
}
HuxButton(
onPressed: () => print('Button pressed'),
child: Text('Primary Button'),
variant: HuxButtonVariant.primary,
size: HuxButtonSize.medium,
icon: Icons.star,
)
HuxTextField(
label: 'Email',
hint: 'Enter your email',
prefixIcon: Icon(Icons.email),
onChanged: (value) => print(value),
validator: (value) {
if (value == null || value.isEmpty) {
return 'Please enter your email';
}
return null;
},
)
HuxCard(
title: 'Card Title',
subtitle: 'Card subtitle',
action: IconButton(
icon: Icon(Icons.more_vert),
onPressed: () {},
),
child: Text('Card content goes here'),
onTap: () => print('Card tapped'),
)
// Simple loading indicator
HuxLoading(size: HuxLoadingSize.medium)
// Loading overlay
HuxLoadingOverlay(
isLoading: true,
message: 'Loading...',
child: YourContent(),
)
// Line chart
HuxChart.line(
data: [
{'x': 1, 'y': 10},
{'x': 2, 'y': 20},
{'x': 3, 'y': 15},
],
xField: 'x',
yField: 'y',
title: 'Sales Over Time',
subtitle: 'Monthly data',
primaryColor: Colors.blue,
)
// Bar chart
HuxChart.bar(
data: [
{'category': 'A', 'value': 30},
{'category': 'B', 'value': 45},
{'category': 'C', 'value': 25},
],
xField: 'category',
yField: 'value',
title: 'Category Analysis',
)
HuxContextMenu(
menuItems: [
HuxContextMenuItem(
text: 'Copy',
icon: FeatherIcons.copy,
onTap: () => print('Copy action'),
),
HuxContextMenuItem(
text: 'Paste',
icon: FeatherIcons.clipboard,
onTap: () => print('Paste action'),
isDisabled: true,
),
const HuxContextMenuDivider(),
HuxContextMenuItem(
text: 'Delete',
icon: FeatherIcons.trash2,
onTap: () => print('Delete action'),
isDestructive: true,
),
],
child: Container(
padding: const EdgeInsets.all(20),
child: const Text('Right-click me!'),
),
)
// Simple avatar with initials
HuxAvatar(
name: 'John Doe',
size: HuxAvatarSize.medium,
)
// Gradient avatar
HuxAvatar(
useGradient: true,
gradientVariant: HuxAvatarGradient.bluePurple,
size: HuxAvatarSize.medium,
)
// Avatar group with overlap
HuxAvatarGroup(
avatars: [
HuxAvatar(name: 'Alice'),
HuxAvatar(name: 'Bob'),
HuxAvatar(useGradient: true, gradientVariant: HuxAvatarGradient.greenBlue),
],
overlap: true,
maxVisible: 3,
)
// Badge variants
HuxBadge(
label: 'New',
variant: HuxBadgeVariant.primary,
size: HuxBadgeSize.small,
)
// Alert with dismissal
HuxAlert(
variant: HuxAlertVariant.success,
title: 'Success!',
message: 'Operation completed successfully.',
showIcon: true,
onDismiss: () => print('Alert dismissed'),
)
All components can be customized using the provided parameters. For more advanced customization, you can extend the theme or override specific component styles.
// Access predefined colors
Container(
color: HuxColors.primary,
child: Text('Primary colored container'),
)
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.