Skip to main content

Crate armas

Crate armas 

Source
Expand description

§Armas

A theme-aware component library for egui, inspired by shadcn/ui.

This is the umbrella crate that re-exports the Armas sub-crates with feature gates.

§Features

  • basic (default) — Core UI components via armas_basic
  • icon (default) — SVG icon system via armas_icon
  • audio — Audio/DAW components via armas_audio

§Quick Start

use armas::prelude::*;

// Set the theme once at startup
// ctx.set_armas_theme(Theme::dark());

// Then use components in your UI code
// Button::new("Click me").variant(ButtonVariant::Default).show(ui);

Re-exports§

pub use armas_icon;

Modules§

animation
Animation utilities and easing functions Animation utilities for smooth, physics-based motion.
color
Color manipulation utilities Color utilities for advanced effects
components
UI components UI components
ext
Extension traits for egui types Extension traits for egui types
fonts
Font utilities Font utilities for loading common fonts with multiple weights
icon
Icon rendering Icon system for Armas
layout
Layout components Layout helpers
prelude
Prelude module - commonly used types and traits
theme
Theme system ARMAS Theme System (shadcn/ui style)

Structs§

Accordion
Accordion with collapsible sections
AccordionResponse
Response from showing an accordion
Alert
Alert component for inline messages
AlertResponse
Response from an alert
Animation
A generic animation that interpolates between two values over time
AnimationSequence
Animation sequence that runs animations one after another
AspectRatio
Maintain aspect ratio wrapper
Avatar
Avatar component for displaying user images or initials
Badge
Small status indicator badge styled like shadcn/ui
BadgeResponse
Response from a badge
BentoGrid
Bento grid layout component
Breadcrumb
Breadcrumb navigation component
BreadcrumbResponse
Response from breadcrumbs
Button
Button component styled like shadcn/ui
ButtonGroup
Button Group — groups buttons with connected borders.
ButtonGroupResponse
Response from a button group.
Calendar
A standalone calendar for date selection.
CalendarResponse
Response from a calendar.
Card
Card component styled like shadcn/ui
CardResponse
Response from showing a card
Carousel
Carousel — a scrollable content strip with snap-to-item behavior.
CarouselResponse
Response from a carousel.
Checkbox
A checkbox component (shadcn/ui Checkbox)
CheckboxResponse
Response from checkbox interaction
CircularProgressBar
Circular progress indicator
ColorStop
Color stop for gradients (position 0.0-1.0, color) A color stop in a gradient, defining a color at a specific position
Command
Command palette component
CommandResponse
Response from command
ContentContext
Context passed to custom content closures.
ContextMenu
Context menu triggered by right-click on a region.
ContextMenuResponse
Context menu response
Date
A date value (year, month, day)
DatePicker
DatePicker component styled like shadcn/ui
DatePickerResponse
Response from a date picker
Dialog
Dialog component styled like shadcn/ui Dialog
DialogResponse
Response from a dialog
Drawer
Drawer component (vaul-style bottom sheet)
DrawerResponse
Response from showing a drawer
DropdownMenu
Dropdown menu component (shadcn/ui Dropdown Menu)
DropdownMenuResponse
Response from showing a dropdown menu
FontFamilyBuilder
Builder for composing multiple font families
FontWeight
Font weight variants
Gradient
Gradient builder for creating various gradient types
HoverCard
Hover Card — appears on hover over a trigger element.
HoverCardResponse
Response from a hover card.
IconButton
Icon Button component
Input
Text input field styled like shadcn/ui
InputGroup
Input group — a text input with leading/trailing addons.
InputGroupResponse
Response from an input group.
Kbd
Keyboard shortcut display component
LoopingAnimation
Animation with loop support
MenuBuilder
Builder for constructing menu contents
Menubar
Menubar — a horizontal menu bar composing DropdownMenu components.
MenubarResponse
Response from a menubar.
NeonPalette
Neon color palette presets for aceternity-style effects
NotificationBadge
Notification badge (typically shows a count)
NumberField
Number field with +/- stepper buttons
NumberFieldResponse
Response from the number field
Pagination
Pagination component for navigating through pages
PaginationResponse
Response from pagination
Popover
Popover component for floating panels anchored to elements
PopoverResponse
Response from showing a popover
Progress
Progress bar styled like shadcn/ui
Radio
Individual radio button
RadioGroup
Radio group for single selection from multiple options
RadioGroupResponse
Response from radio group
RadioResponse
Response from radio button interaction
RangeSlider
Range slider with two thumbs for min/max selection
RangeSliderResponse
Response from a range slider
Resizable
Resizable panel group — panels separated by draggable handles.
ResizablePanel
Configuration for a single panel in a resizable group.
ResizableResponse
Response from a resizable panel group.
SearchInput
Search input with built-in search icon
Select
Searchable dropdown select component
SelectOption
A selectable option in a dropdown
SelectResponse
Response from showing a Select component
Separator
Simple separator/divider component
Sheet
Sheet component
SheetResponse
Response from showing a sheet
Sidebar
Animated sidebar component styled to match shadcn/ui
SidebarResponse
Response from sidebar interaction
SidebarState
Sidebar state that can be stored externally for controlled mode
Skeleton
Skeleton loader for placeholder content
Slider
Slider component
SliderResponse
Response from a slider
Spinner
Rotating spinner with multiple bars
SpringAnimation
Spring-based animation for smooth, physics-based motion
StaggeredAnimation
Staggered animation system for multiple items
Switch
Animated switch component (shadcn/ui Switch)
SwitchResponse
Response from switch interaction
TableCells
Builder for table cells
TableRows
Builder for table rows
Tabs
Tabs component for switching between content sections
TabsResponse
Response from the tabs component
Textarea
Multi-line text input field styled like shadcn/ui
Theme
Complete theme with colors and spacing
ToastId
Opaque handle returned when creating a toast, used to update or dismiss it.
ToastManager
Toast notification manager
Toggle
A pressable button with on/off state (shadcn/ui Toggle)
ToggleGroup
A group of pressable toggle buttons for selection (shadcn/ui Toggle Group)
ToggleGroupResponse
Response from toggle group interaction
ToggleResponse
Response from toggle interaction
Tooltip
Tooltip component that shows contextual help on hover
TreeItem
A tree view item (file or folder)
TreeView
Hierarchical tree view component
TreeViewResponse
Response from the tree view

Enums§

AlertVariant
Alert variant
AnimationState
Animation state
AvatarShape
Avatar shape
AvatarSize
Avatar size presets
BadgeVariant
Badge variant styles (shadcn/ui)
BlendMode
Blend modes for color composition
ButtonGroupOrientation
Button group orientation.
ButtonSize
Button size following shadcn/ui
ButtonVariant
Button style variant following shadcn/ui
CardVariant
Card variant (shadcn/ui style)
CarouselOrientation
Carousel orientation.
CollapsibleMode
Collapsible mode for the sidebar
ContentMode
How content should be sized within the aspect ratio container
DialogSize
Dialog size presets (max-width based like shadcn)
DrawerSnapPoint
Drawer snap points for partial open states
EasingFunction
Easing function type
GridSpan
Grid item span configuration
InputState
Input validation state
InputVariant
Input field variant (for backwards compatibility)
LoopMode
Loop mode for repeating animations
PopoverColor
Popover color themes
PopoverPosition
Popover position relative to anchor
PopoverStyle
Popover visual style
RadioSize
Radio button size
ResizableDirection
Direction of the resizable panel group.
SeparatorOrientation
Separator orientation
SheetSide
Side from which the sheet slides in
SheetSize
Sheet size presets
SidebarVariant
Sidebar visual variant
SwitchSize
Switch size
ToastPosition
Position for toast notifications
ToastVariant
Toast notification variant
ToggleGroupSize
Toggle group item size
ToggleGroupType
Toggle group selection type
ToggleGroupVariant
Toggle group visual variant
ToggleSize
Toggle size
ToggleVariant
Toggle visual variant
TooltipPosition
Tooltip position relative to the target

Traits§

ArmasContextExt
Extension trait for storing Armas theme in egui Context
PainterExt
Extension trait for egui’s Painter with advanced effects

Functions§

alert
Simple helper to show an alert with just a message
alert_destructive
Show a destructive alert
blend
Blend two colors using different modes
cell
Add a text cell to the current row
cell_ui
Add a custom cell with custom content
dialog_footer
Helper to render a dialog footer (right-aligned buttons)
header_row
Add a header row to the table
lerp_color
Interpolate between two colors
neon_circle
Draw a glowing circle
neon_line
Draw a neon line with glow effect
row
Add a data row to the table
saturate
Saturate/desaturate a color
table
A table component following shadcn/ui design
tooltip
Helper function to show a simple tooltip on any UI element
tooltip_with
Show tooltip with custom configuration
with_alpha
Add alpha to a color