Skip to main content

Module widgets

Module widgets 

Source
Expand description

Ready-made widgets. Every one takes its look from the theme and works with keyboard and mouse.

Re-exports§

pub use crate::date::TimeOfDay;

Structs§

Accordion
A vertical list of titled sections; each opens with a click or Enter to show its body.
AppShell
Builds the common application frame: a header on top, a sidebar on the left, the body beside it and a footer at the bottom.
Axis
A row of labels along the edge of a chart: hours of a day, weekdays, months, or names of your own.
Badge
A status pill: a tinted surface with a marker dot and a word, and optionally a count.
Bar
One bar of a BarChart.
BarChart
Bars measured in eighths of a cell, with labels and values.
BigText
Text drawn large from block elements: digits, :, ., %, - and the letters A to Z.
Breadcrumb
The path to the current place, such as workspace › quvyta › crates › src.
Button
A button: the shape is its surface colour, never brackets.
Checkbox
A box that is checked or not, with an optional label.
CodeView
Code with syntax colours, line numbers and wrapping of long lines.
Column
A column of a Table: a title, a width rule, an alignment and whether it can be sorted.
CommandPalette
A layer with a filter field over a list of commands, for running anything from the keyboard.
ContextItem
One row of a menu: an action, a submenu or a gap between groups.
ContextMenu
Wraps an area and opens a menu of ContextItems at the pointer on a right click, or next to the focused widget on Shift+F10 or the menu key.
CopyValue
A value on a raised surface that copies itself to the clipboard: an install command, a token, a URL.
DatePicker
A field showing a chosen date that opens a calendar to choose another.
Divider
A pause between groups of content.
DurationInput
A length of time edited segment by segment: hours and minutes, optionally seconds, each followed by its unit in the active language: 1 h 30 min, 1 sa 30 dk.
EmptyState
A centred block explaining why an area is empty and what to do about it.
Field
A labelled control: the label, the control the application adds inside, and under it a faint hint or, when there is one, the error in the danger colour with a marker.
FileBrowser
The application-owned state of a FilePicker.
FileEntry
One entry of a folder.
FilePicker
Browses folders and chooses a file or a folder.
Form
A column of Fields that share one label layout, with an optional summary of problems above them.
FormErrors
The problems of a form, in the order the application found them, each under the name of the control it belongs to.
FormFields
Adds fields to a Form inside Form::show.
Gauge
A one-row meter for a value in a range: label, meter and value.
Heatmap
A grid of days as tones: one cell per value, a column per week, the tone carrying how much that day holds.
HelpLayer
A layer listing every key binding: the hints of the current screen first, then the application’s keymap actions, then the framework’s. Labels come from the language files (keys.<action> and quvyta.keys.<action>), keys from the keymap, so rebinding a key or switching the language updates the list.
HoldToConfirm
A control that sends its message only after a key or the mouse button is held on it.
KeyHints
A bar of key hints such as tab next ctrl q quit, fed from the keymap and from hints the application adds for the current screen.
Legend
The names behind the tones of a chart: a patch of colour and the name it stands for.
List
A vertical list that only draws the rows it shows, so it stays fast with any number of items. For a very long list, keep the items as an Arc<[ListItem]> in your state and pass it to List::shared, so they are not built again every frame.
ListItem
One row of a List.
LogBuffer
A bounded store of log lines: when full, pushing drops the oldest line.
LogLine
One line of a log.
LogView
A view of a LogBuffer that follows new lines as they arrive.
Markdown
Rendered Markdown: headings with the accent pillar, wrapped paragraphs, lists, quotes and highlighted code blocks. Horizontal rules become space, never a drawn line.
Menu
The navigation column of an application: groups of destinations under faint headings.
MenuGroup
A group of items in a Menu, with an optional faint heading.
MenuItem
One destination in a Menu.
Modal
A dialog over a dimmed screen: a title, any content and action buttons.
NumberInput
A text field for a number: typing edits it like a text input, Up and Down step it.
PageTransition
Wraps the current page and animates whenever its key changes.
PaletteCommand
One command of a CommandPalette.
Panel
A surface one step above its background, optionally titled, selectable and pressable.
Popover
Content shown as a layer next to an anchor, such as a filter panel under a button.
ProgressBar
A bar that fills as work completes, or sweeps while the amount is unknown.
RadioGroup
A set of options of which exactly one is chosen, for a few choices that should all stay visible. For many choices use a Select.
RailTab
One tab of a TabRail.
ScrollMetrics
Position of a scrolled view: how many rows exist, how many are visible and the first visible row.
ScrollView
Shows content taller than its area and scrolls it with the wheel, the scrollbar or the keyboard (↑/↓, PgUp/PgDn, Home/End while focused). When focus moves to a widget inside that is out of view, the view scrolls to it.
Section
The title of one section of an Accordion or a WidgetDock: a label with an optional icon and a faint detail on the right, such as a count.
Segmented
Side-by-side segments of one surface, of which the filled one is chosen: for two to five short, mutually exclusive choices such as a view mode, where the choice should read at a glance.
Select
A field showing the chosen option that opens a list of options as a layer.
Series
One series of a BarChart: a name and one value per category.
SettingRow
One setting of a SettingsList: a label, an optional description and the control added with SettingsRows::row.
SettingsList
Settings, one per row: the label (and a faint description) on the left, its control anchored on the right.
SettingsRows
Adds headings and rows to a SettingsList inside SettingsList::show.
ShimmerText
A working message such as “processing”: either light passing over the letters or growing dots. One pass takes the theme’s motion.shimmer; with reduced motion the text is still.
SidePanel
A panel docked to the left or right of a body, on its own surface.
Skeleton
A placeholder in the shape of content that is on its way: text lines, an avatar or a block.
Slider
A value chosen along a range by moving a knob on a rail.
Span
A run of text with its own look inside a Text.
Sparkline
A compact trend: one column per value, newest on the right, measured in eighths of a cell.
Spinner
A one-cell indicator that something is working, with an optional label.
Splitter
Two panes that share an area: side by side with Splitter::columns, stacked with Splitter::rows. The application owns the size of the first pane; the second takes the rest.
Steps
Where a sequence of steps stands: finished steps carry a check in the success colour, the current step is bold with an accent marker, and upcoming steps are faint. Steps are set apart by space and tone; nothing connects them.
Switch
An on/off switch that applies at once, with an optional label.
TabRail
Tabs stacked down the side of the screen, such as the open projects of an IDE.
Table
Rows of cells under a header row. Only the rows on screen are drawn, so a table stays fast with any number of rows; pass the rows as an Arc<[TableRow]> kept in your state to avoid copying them every frame.
TableCell
One cell: text, optionally with an icon and a colour.
TableRow
One row of a Table.
Tabs
A row of tabs. The open tab is a raised surface; tabs are never boxed or bracketed.
TaskList
Shows a Tasks model as rows built from existing widgets.
Text
Text that wraps to its width, or is cut with when wrapping is off.
TextArea
A multi-line text field with word wrap, scrolling and real editing.
TextInput
A text field with real editing: cursor, selection, word jumps, undo and clipboard.
TimeBlock
One block of a Timeline: a stretch of the day with a name, such as work from 09:00 to 11:10.
TimeInput
A time of day edited segment by segment: hours and minutes, optionally seconds, on a 24-hour clock written the same in every language.
Timeline
A day as a strip: blocks of colour for what filled it, the empty track for the gaps between them — breaks, sleep, time not recorded.
Toast
A notification: a status marker and icon, a title, an optional body and action, and the shared three-cell close mark at the end of the title row.
Tooltip
Wraps widgets and shows a short text next to them after the pointer rests on them for the theme’s motion.hover-delay.
Tree
Nested rows that open and close, like folders.
TreeMove
A move of one node among its siblings that a reorderable tree asks for. The tree never changes the application’s nodes; apply does the bookkeeping on the application’s own list of siblings.
TreeNode
One node of a Tree, identified by a key that stays the same while the tree changes.
WidgetDock
A vertical stack of titled widgets filling the area it is given, like the side panel of an IDE: each widget opens and closes, and open widgets share the height between them.
Wizard
A flow of pages the user goes through in order: Steps on top, the current step’s page, and a row of buttons.

Enums§

CheckboxStyle
How a Checkbox looks.
Closed
What closing a SidePanel leaves behind.
CollapsedMarker
What the one-cell marker of a tab in a collapsed TabRail shows.
ColumnWidth
How wide a Column is.
Corner
The screen corner toasts stack in.
DurationError
Why a written length of time could not be read. message says it in the active language.
DurationUnit
A unit of a length of time.
FilePickerMsg
Something that happened in a FilePicker. Hand every message to FileBrowser::update, except FilePickerMsg::Chosen, which is the result.
Gradient
Which way a BigText gradient runs.
ItemKind
What kind of row an item is.
Language
A language CodeView can colour.
ListingError
Why a folder could not be read.
LogLevel
How important a log line is.
Overflow
What a Tabs strip does when its tabs do not fit.
PickMode
Whether a picker chooses files or folders.
Placement
The side of its anchor a layer prefers. When the layer does not fit there it flips to the opposite side, and it is always kept on screen.
RadioStyle
How the options of a RadioGroup are marked.
ScrollbarStyle
How a scrollbar is drawn. The theme picks one with [style.scrollbar] style = "…"; scrolling widgets can pin one with their scrollbar option.
ShimmerStyle
How ShimmerText moves.
Side
Which side a SidePanel is docked to.
SortDirection
Which way a sorted column is ordered.
SpinnerStyle
How a Spinner moves. Every style is a built-in cell animation with Nerd Font, Unicode and ASCII frames, which themes and applications can replace.
SwitchStyle
How a Switch looks.
TabEdit
A change a closable or reorderable tab view asks for. Tab views never change the application’s tabs themselves; TabEdit::apply does the bookkeeping on the application’s own list.
TabWidth
How wide each tab of a Tabs strip is.
ToastKind
What a toast reports; picks its status colour and icon.

Functions§

parse_duration
Reads a length of time written by hand, in any language i18n knows.
read_folder
Reads the entries of folder, folders first, then by name ignoring case. Blocks on the file system: call it from Command::perform, never from view.

Type Aliases§

Listing
What reading a folder gave.