Skip to content
Drew Chase (Home) edited this page Mar 27, 2026 · 1 revision

Form Components

Interactive input components for building forms. All live in aurora_widgets::components and require the text feature.

For single-line text input, see TextInput. For multi-line, see TextArea below.


Checkbox

A toggle checkbox with optional label.

Checkbox::new()
    .checked(true)
    .label("Accept terms")
    .on_change(|checked| println!("Checked: {checked}"))
Method Description
checked(bool) Initial state
label(impl Into<String>) Text label
size(f32) Checkbox size in pixels
disabled(bool) Disable interaction
on_change(FnMut(bool)) Fires when toggled

Switch

A toggle switch (on/off).

Switch::new()
    .checked(false)
    .on_color(Color::from_hex(0x22c55e, false))
    .on_change(|on| println!("Switch: {on}"))
Method Description
checked(bool) Initial state
disabled(bool) Disable interaction
on_color(Color) Track color when on
off_color(Color) Track color when off
on_change(FnMut(bool)) Fires when toggled

Slider

A horizontal slider for numeric input.

Slider::new()
    .value(0.5)
    .min(0.0)
    .max(100.0)
    .step(1.0)
    .on_change(|value| println!("Value: {value}"))
Method Description
value(f32) Current value
min(f32) / max(f32) Range bounds
step(f32) Snap increment
width(f32) Track width
track_color(Color) Unfilled track color
fill_color(Color) Filled portion color
thumb_color(Color) Thumb color
disabled(bool) Disable interaction
on_change(FnMut(f32)) Fires on value change

RadioGroup

A group of mutually exclusive radio buttons.

RadioGroup::new()
    .item("Small")
    .item("Medium")
    .item("Large")
    .selected(1)
    .on_change(|index| println!("Selected: {index}"))
Method Description
item(impl Into<String>) Add a radio option
selected(usize) Initially selected index
radio_size(f32) Radio circle diameter
spacing(f32) Gap between items
on_change(FnMut(usize)) Fires with selected index

Toggle

A toggle button (pressed/unpressed).

Toggle::new()
    .label("Bold")
    .pressed(false)
    .on_change(|pressed| println!("Pressed: {pressed}"))

ToggleGroup

A group of toggle buttons where one (or none) is active.

ToggleGroup::new()
    .item("Left")
    .item("Center")
    .item("Right")
    .selected(0)
    .on_change(|index| println!("Selected: {index}"))

Tabs

A tabbed panel with tab headers and content switching.

Tabs::new()
    .tab("General", general_content)
    .tab("Advanced", advanced_content)
    .selected(0)
Method Description
tab(impl Into<String>, impl Widget) Add a tab with label and content
selected(usize) Initially selected tab
tab_height(f32) Tab header height
tab_padding(f32) Horizontal padding in tabs
indicator_height(f32) Active tab indicator thickness
indicator_color(Color) Active tab indicator color
width(f32) Fixed width

Accordion

Collapsible sections that expand/collapse on click.

Accordion::new()
    .section("Section 1", Text::new("Content for section 1"))
    .section("Section 2", Text::new("Content for section 2"))
    .allow_multiple(false)
Method Description
section(impl Into<String>, impl Widget) Add a collapsible section
allow_multiple(bool) Allow multiple sections open at once
header_height(f32) Section header height
header_padding(Edges) Header inner padding
content_padding(Edges) Content inner padding
border_color(Color) Section border color
spacing(f32) Gap between sections

Collapsible

A single collapsible section with a trigger and content.

Collapsible::new()
    .trigger(Text::new("Click to expand"))
    .content(Text::new("Hidden content"))

ButtonGroup

A row of buttons that share borders and form a connected strip.

ButtonGroup::new()
    .button(button!("Cut"))
    .button(button!("Copy"))
    .button(button!("Paste"))

InputGroup

A text input with attached prefix or suffix elements.

InputGroup::new()
    .prefix(Text::new("$"))
    .input(TextInput::new().placeholder("Amount"))
    .suffix(button!("Send"))

Field

A form field wrapper with label, input, and optional description/error message.

Field::new()
    .label("Email")
    .input(TextInput::new().placeholder("you@example.com"))
    .description("We'll never share your email.")

TextArea

A multi-line text input.

TextArea::new()
    .placeholder("Write your message...")
    .rows(5)
    .width(400.0)
    .on_change(|text| println!("Text: {text}"))
Method Description
placeholder(impl Into<String>) Placeholder text
text(impl Into<String>) Initial value
rows(usize) Visible line count
width(f32) / height(f32) Fixed dimensions
tab_index(u32) Tab navigation order
on_change(FnMut(&str)) Fires when text changes
on_submit(FnMut()) Fires on Enter

AuroraUI is a cross-platform desktop UI framework that treats performance as a first-class constraint — not an afterthought.

Platform

  • App - Application builder, windowing, and event loop
  • MultiWindow - Window spawning, modals, messaging
  • Native Menu - OS menu bars (menu feature)
  • System Tray - System tray icons (tray feature)
  • Threading - Background tasks, thread-safe state

Core

  • Color - Color utilities and color schemes
  • Undo / Redo - UndoStack and text input undo

Geometry

  • Rect - Rectangle geometry
  • Point - Point geometry
  • Size - Size geometry
  • Edges - Edge insets (padding, margins, borders)
  • Corners - Corner radii for rounded rectangles

GPU

  • GpuContext - GPU surface abstraction and backends

Render

Text

Widgets

  • Layout - Column, Row, Stack, Positioned
  • ScrollView - Scrollable viewport with scrollbar
  • VirtualList - Virtualized list for large datasets
  • Button - Styled button with any child content
  • BoxWidget - Colored rectangle container
  • TextInput - Single-line text input
  • TouchArea - Invisible hit-testing region
  • Drag & Drop - Draggable sources and drop zones
  • ContentSwitch - Conditional child display
  • Image - Raster image display (PNG, JPEG)
  • Composite - Stateful composites & #[composite_widget]
  • TreeView - Hierarchical data with expand/collapse

Components

  • Display - Badge, Card, Alert, Progress, Spinner, Kbd, and more
  • Stepper - Step-by-step progress indicator
  • Forms - Checkbox, Switch, Slider, RadioGroup, Tabs, Accordion, and more
  • SegmentedControl - iOS-style segmented toggle bar
  • NumberInput - Numeric input with +/- buttons
  • RichTextEditor - Rich text editing with bold/italic/underline
  • Form Validation - Validators, error states, form-level validation
  • Overlays - Tooltip, Popover, Dialog, DropdownMenu, Select, Toast
  • Sheet - Slide-in panel from screen edge
  • TagInput - Multi-value input with removable tags
  • SplitPane - Resizable split view with drag handle
  • ColorPicker - Color selection with hex/RGB
  • TimePicker - Time selection with hour/minute spinners
  • DateRangePicker - Dual-calendar date range selection
  • DateTimePicker - Combined date and time selection
  • Data & Advanced - Table, Calendar, Combobox, Command, and more

Theme

  • Theme - Color profiles, slots, and runtime switching

Animation

  • Animation - Tweens, easing, keyframes, timelines, and presets

Code

  • Syntax - Syntax highlighting for 16+ languages

Accessibility

Internationalization

  • i18n - Locale detection, message formatting, RTL layout

Integrations

  • Iconify - Compile-time icons from iconify.design
  • Fonts - Compile-time Google Fonts embedding

Clone this wiki locally