Skip to main content

Crate ravenrs_widgets

Crate ravenrs_widgets 

Source
Expand description

Declarative views and the UI runtime.

§Writing components

There are three ways to make your own component, from simplest to most powerful:

  1. A function returning impl View, composing existing views. Good for stateless pieces of UI.
  2. A Component: a struct holding its state (State fields, bindings, callbacks) with a body() that composes views. This is the SwiftUI-style building block and covers most needs.
  3. A View implemented directly: full control over layout boxes, painting (including arbitrary Scene drawing through Paint::Custom), hit-testing, focus and click handling via BuildCx. The built-in widgets are written this way, with no private API.

Canvas is the shortcut for custom drawing inside a normal layout.

§Features

  • decode (default): PNG and JPEG decoding for Image::from_bytes.
  • charts (default): Chart, BarChart, AreaChart and Barcode. They draw the same charts and codes as reports, through ravenrs-graphics.

§Runtime

Ui owns the root view and turns it into a Scene: build (views to elements, tracked by a reactive observer), layout (Taffy), paint. It only rebuilds when state the last build read has changed or the interaction state (hover, press, focus) changed, and it never touches the GPU.

§Motion

A view declares how a node moves with BuildCx::motion and the runtime plays it. While only animations run, frames repeat the paint phase alone, so views are not rebuilt. When nothing moves, no frames are requested.

Re-exports§

pub use grid::CellAlign;
pub use grid::CellEdit;
pub use grid::ColumnLayout;
pub use grid::DataGrid;
pub use grid::FilterLayout;
pub use grid::GridCellStyle;
pub use grid::GridColumn;
pub use grid::GridData;
pub use grid::GridExportFormat;
pub use grid::GridLayout;
pub use grid::GridPage;
pub use grid::GridRequest;
pub use grid::GridResponder;
pub use grid::GridRowAction;
pub use grid::GridScenario;
pub use grid::GridTable;
pub use grid::GridTableColumn;
pub use grid::GridTableKind;
pub use grid::NumberFormat;
pub use grid::RemoteRows;
pub use grid::SelectionMode;
pub use grid::SortDirection;
pub use grid::SortLayout;
pub use grid::Summary;
pub use grid::Value;

Modules§

grid
An enterprise-style data grid: DataGrid over GridData with GridColumns. The query pipeline in query is pure and usable on its own.
validate
Common validation rules for FormField::validate.

Structs§

AccessibleControl
A control with a name and a description of its own for screen readers, for one that has no label around it to take them from, such as a check box that says its own caption.
Accordion
Disclosures separated by hairlines.
Alert
A tinted message box with an icon, a title and a description.
AlertAction
What Alert::action adds to an alert. Its own type parameter, so an alert without a button stays Send.
Anchor
A place links with #name scroll to, landing offset pixels below the top of the scroll container. See BuildCx::anchor.
AreaChart
A smooth area chart (sparkline style) of evenly spaced values.
AspectRatio
Keeps its content at a width-to-height ratio while filling the width.
Attachment
A file in an AttachmentStrip.
AttachmentStrip
The files about to go with a message: icon or thumbnail, name, size, how to send each one and a button to take it out. It keeps nothing: the app holds the list and changes it when told.
AudioPlayerButton
A button that plays a recording and stops it, with its progress and, when there is one, a transcript to open. Space and Enter work on the button, as on any.
Avatar
A round avatar showing a picture, or initials on a color picked from the name.
Badge
A small pill label: status, counts, categories.
BarChart
A bar chart with labels under each bar and faint gridlines.
Barcode
A QR Code or a linear barcode, drawn so that every module lands on whole pixels. Scanners need dark on light, so it stays that way in dark themes.
BoxTransform
A rectangle turned around a point, which is what a TransformHandles edits.
Breadcrumb
A path of locations, the last one being the current page. With on_navigate the locations before it can be clicked.
BuildCx
What a View uses to describe itself during a build: theme access, interaction state, child building, layout boxes, painting and behavior.
Button
A clickable, focusable button. Activates on click, Enter or Space.
ButtonGroup
Buttons glued side by side, as one control. Each one stays a whole Button, with its own style, icon, state and handler; marking one as chosen is up to whoever makes them.
Calendar
A month grid to pick a date. Use ‹ › to change month. From the keyboard the grid is one Tab stop: arrows move by day and week, Home and End to the ends of the week, Page Up and Page Down by month, and Enter or Space picks.
CalendarEvent
Something on a EventCalendar’s day.
Canvas
A box of a given size that draws whatever its closure appends to the scene. The closure receives the box’s absolute frame in logical pixels.
Card
A grouped surface lifted off the canvas: bg-200 fill, radius-xl corners, shadow-soft and a hairline border, padded by space-6.
CardView
Records as cards, in as many columns as fit, of which only those in sight are built. Arrows move between cards, Enter opens one and Space selects it.
Carousel
Slides with previous/next buttons, position dots and optional autoplay.
Chart
A chart of any ChartKind. Its shapes are drawn into a picture at the screen’s density, and its labels are real text. Over the picture it says what each value is, under the pointer or with the arrow keys. ChartKind::Scatter and the sparklines stay as plain pictures, which take no focus, until given a tooltip.
ChartCard
A chart’s card: its title and description, what changes it, and what it says at the bottom, such as how it compares to last month.
ChartReference
A dashed line across a Chart at a value that matters, such as a target.
ChartTooltip
What a Chart says about the category under the pointer or the arrow keys.
Chat
A conversation over a field to write in. It fills what its parent gives it and follows the newest message.
ChatMedia
What a ChatMessage carries in its bubble, above its text: a photo, a document or a recording. The file stays with the app, which asks to open it from Self::on_open.
ChatMessage
One message of a Chat.
Checkbox
A check box with a label.
Clipboard
A shared handle to the clipboard, from crate::BuildCx::clipboard or crate::Ui::clipboard.
CodeBlock
A line of text to copy, such as a command: shown apart from the prose, with a button that puts it on the clipboard.
CodeDiagnostic
Something found at a place in the code: what CodeEditor::diagnostics marks and what a Playground lists under its editor.
CodeEditor
A source code editor: monospaced, no wrapping, line numbers, colors for the language, Tab and Shift+Tab to indent, and Enter keeping the indentation. Ctrl or Cmd with Enter is left to shortcuts, so a surrounding Playground can run the code. Diagnostics mark their lines and underline what they cover.
Collapse
Animates its content’s height as it opens and closes: the “height: auto” transition. The content stays built until it has finished closing.
ColorPair
A foreground and a background color, one over the other, with a button that swaps them.
ColorPicker
Picks a color: from a palette, on a shade square and a hue bar, or typed in hexadecimal. The square moves with the arrows, the bars with Left and Right.
ColorSwatch
A round color to pick, from a palette of ColorSwatches. Its hit target is 32 px; the color itself is 20 px.
ColorWheel
Picks hue and saturation on a disc, by a drag or the arrow keys: left and right turn the hue, up and down change the saturation, with Shift for bigger steps. Holding Shift during a drag keeps the hue. A double click or Home takes the color out, keeping the hue.
Column
A table column: title, relative width and alignment.
Combobox
A select with a search box: type to filter the options.
Command
An action in the CommandPalette.
CommandPalette
A searchable list of commands in a modal, opened with Cmd/Ctrl+K. Type to filter (fuzzy), use ↑ ↓ to choose, Enter to run, Escape to close.
CompareView
Two pictures to tell apart: side by side, or one over the other with a divider between what shows of each. The divider follows a drag from anywhere, the arrows (with Shift, further), Home and End, and a double click puts it in the middle. A picture that does not have the proportions of the box is fitted in it, centered.
ConfirmDialog
A question before something that cannot be undone. Holds what is being asked until it is answered; show ConfirmDialog once, and call ask from anywhere.
ContextMenu
Opens a menu at the pointer on right click (or long press, planned) over its content.
CountUp
A number that counts up from zero to its value when it first shows on screen, and from where it is to its new value whenever the value changes, even halfway through a count. Its digits keep one width, so the number does not shake as it counts. Under reduced motion it shows the value at once.
CropArea
What a CropOverlay edits: a rectangle of the content and how far it is turned.
CropOverlay
A crop over a picture: what is out of the frame goes dark, with thirds inside the frame and a fine grid while it turns. It is built on TransformHandles and draws the same lines as RuleOfThirdsGrid.
CurveEditor
Editable points over a smooth curve that never swings past them. A press on empty space adds a point and a drag moves it; a double click or Delete removes one, except the two ends. From the keyboard, the arrows move the chosen point (with Shift, further), Page Up and Page Down choose another, and Enter adds one on the curve halfway to the next.
Date
A calendar date (year, month, day), always valid.
DatePicker
A field that opens a calendar in a popover.
DateRange
Two days and the days between them, both included.
DateRangePicker
A field that opens two months to pick where a period starts and ends, with ready-made periods on the side. The first click starts the period, the second ends it.
DateTime
A date and a time of day, with no time zone.
DateTimePicker
A DatePicker beside a TimePicker, over one value. Picking a date first sets the time to midnight, and clearing the time clears both.
DayMark
What marks a day of a YearView.
DaySeparator
A line with a word in the middle that divides a list by day: “Today”, “Yesterday”.
DecodeError
Why image bytes could not be decoded.
Diagnostics
What a platform shares with the panel of a DiagnosticsHost: it records frames here, says how to describe the GPU, and opens the panel.
DiagnosticsHost
Shows root and, while Diagnostics says so, the diagnostics panel over it. Closed, it adds nothing to the UI: no element and no wake-up.
Dialog
A modal dialog over a dimmed backdrop, shown while open is true. Clicking the backdrop, the close button or pressing Escape closes it, and each of the three can be turned off for what must not be dismissed by accident.
Disclosure
A header that shows or hides its content. Remembers whether it is open, or leaves that to the app with expanded. The header can carry any view as its title, a mark such as a Dot, and an on/off switch of its own.
Divider
A hairline separator. Horizontal dividers stretch across their stack.
DockArea
Panels in a tree of splits and groups of tabs, at the left, the right, the bottom and the center of a space. Bars between them resize with the pointer or the keyboard, docks collapse from the strips on their edges, and panels close and come back.
DockChild
A part of a split and how much of it it takes.
DockLayout
The arrangement of a DockArea: which panel is where, the sizes, and what is collapsed or closed. It holds ids only, so it can be kept in a State, compared and saved; what a panel shows comes from the app, by id, each time it is drawn.
DockPanel
A panel of a DockArea: what it is called and whether it can close. What it shows comes from the function given to the area, by its id.
DocumentTab
An open document in a DocumentTabs.
DocumentTabs
Tabs for open documents, as a browser or an editor has: they close, change places by dragging or with Alt and the arrows, are renamed with a double click, F2 or the menu, carry a color and a dot for what was not saved, and scroll with arrows when they do not fit. The arrows alone move between them, and Delete closes. The tabs belong to the app, which applies what the handlers tell it.
Dot
A small round mark of state, such as “not saved”.
Drag
A pointer drag on an element, in absolute logical pixels, with the element’s frame.
DropZone
A dashed area around any content, which takes files dropped on it and shows when they are over the window. Unlike FileUpload it keeps no list: the files go to DropZone::on_files, and what it holds and how it looks are up to the content.
DropdownMenu
A button that opens a list of actions. The first item takes focus as the menu opens; arrow keys move, Enter runs, Escape closes, and focus returns to the button.
EmptyState
What an area shows when it has nothing: an icon, a title, a sentence and what to do.
EventCalendar
A month with its events inside each day, for agendas and bookings. Use a Calendar to pick a date and this to see what is on them.
ExpressionEditor
An expression editor, as report designers have: the expression in several lines, the fields, parameters, functions, operators and constants that can go in it, a search, the signature and description of the chosen one, and a check as the text changes.
Eyedropper
The button that arms an eyedropper, which looks pressed until a color is picked or Escape disarms it. The color comes from an EyedropperArea or from EyedropperState::pick: nothing here can read the screen.
EyedropperArea
Where an eyedropper picks from, over a picture. While armed, a click asks sampler for the color at that point of the content, in the units of the space; a point out of the content or a None picks nothing and leaves it armed. While not armed it takes no input.
EyedropperState
What an Eyedropper and an EyedropperArea share, and how a color reaches them: from the area, or from whoever knows the color under the pointer through pick. Nothing here can read the screen, so the color always comes from the caller.
Faded
A view drawn at an opacity, such as the last result a playground keeps while its code has problems; see ViewExt::opacity. Each shape fades on its own, so overlapping shapes show through each other while it is partly faded.
FavoriteToggle
A heart that marks something as a favorite: filled when on, an outline when off.
FileBrowser
An explorer of folders and files: a breadcrumb that goes back, a header that sorts, and a list of any length with icon, name, size and date. The entries are data from the app, which answers on_navigate and on_open with another folder; it never touches the file system, so it serves a backup on a server as well as a disk. A click selects alone, Ctrl or Cmd adds, and Shift takes a range. The arrows, Home and End move, Space adds, Enter opens, and Backspace goes up.
FileEntry
A folder or file of a FileBrowser. Nothing here touches the file system: it says what the app knows, wherever that came from.
FilePicker
A shared handle to the file chooser, from crate::BuildCx::file_picker.
FileRequest
What to ask of a FilePicker.
FileSort
The order of a FileBrowser. Folders always come first.
FileUpload
A place to bring files, with the system’s chooser or by dropping them, and the list of what came in. Refused files say why. The app reads PickedFile::bytes, and sending them somewhere is up to it.
Filmstrip
A horizontal strip of thumbnails that builds only what shows, so thousands cost the same as a few. Each cell comes from whoever uses it, with its own image, stars or badges; the strip draws the frame around it. A click selects alone, Ctrl or Cmd adds, and Shift takes a range; the arrows, Home and End move and keep the selected cell in view, Space adds, Enter activates. Arrows appear on the ends that have more to show.
FilmstripCell
What a cell of a Filmstrip is told when it is drawn.
FilterBuilder
Builds a filter out of lines of field, comparison and value, in groups that need all or any of their lines. It reads and writes the same expression language as the rest of RavenRS, and a part it cannot show as a line stays editable as text.
FilterField
A field a FilterBuilder offers.
FloatingPanel
A round button in the corner of the window that opens a panel over the app. The app stays usable behind it, and Escape or the sphere closes it. Dragging it or pressing an arrow key sends it to another corner, and it stays there while the app runs.
FloatingToolbar
A translucent row of commands floating over its content, such as a zoom bar over a photo. Clicks on it never reach the content. Tab goes through its commands.
FnView
A view produced by a closure on every build; see view_fn.
Footer
The band that ends a page or an app: copyright, links, version, status.
FormField
A labeled form field with a hint and validation messages.
FormGroup
A titled set of fields in a FormLayout, filling its columns row by row.
FormLayout
The body of a form: groups of fields in columns, tabs below them, and a list of what keeps it from being saved at the top. Columns collapse when the form is narrow.
FullScreen
A shared handle to the full screen service, from crate::BuildCx::full_screen or crate::Ui::full_screen.
GlassCard
A translucent card for Raven Glass compositions: a light, see-through fill and a brighter hairline over whatever is behind it.
Grid
Lays children out in equal-width columns, wrapping into rows.
HStack
Arranges children left to right.
HelpTip
A small “?” beside something that needs explaining. Its panel opens under the pointer and on keyboard focus, and a click keeps it open until a click elsewhere. Screen readers get the same words as the button’s description.
HeroBanner
A wide band in a strong color, readable from across the room: “You can remove the card”.
Histogram
Overlapping channels from ready-made bins, in a linear or logarithmic scale, with a mark at each end when too much of a channel piles up there. Where channels overlap, their colors add up, as light does, so each stays readable.
HistogramChannel
One series of a Histogram: ready-made bins and the color that shows them.
Hotkey
A key combination that runs a command: a key, with Cmd (macOS) or Ctrl, and Shift.
HoverCard
Rich content shown below a trigger while the pointer is over the trigger or the card itself.
HueSaturation
A color as a ColorWheel holds it, without brightness.
Icon
A vector icon from the built-in Lucide set, drawn as a glyph so it stays crisp at any size and takes the text color.
IconButton
A square, icon-only button (ghost by default), for toolbars.
IconTile
An icon in a square tinted with its color, beside a title or at the top of a notice.
Image
Shows an image. Without a size it takes the image’s own size in logical pixels; with only a width (or height) it keeps the aspect ratio. With crossfade, a new image dissolves over the one before it.
ImageField
A picture chosen by the person: what it looks like now, and buttons to change it or take it off. Takes PNG and JPEG, and refuses what it cannot show.
ImageLightbox
Pictures over the whole app, one at a time, with zoom by ZoomPanView, a caption and a counter. It shows while open holds the index of a picture, and Escape or its X set it to None.
IndicatorStep
One step shown by a StepIndicator.
InlineRename
A name that turns into a field: a double click, F2 or Enter starts, Enter confirms, Escape cancels, and clicking elsewhere confirms. The keyboard goes back to the name after Enter or Escape. An empty name, or one that did not change, changes nothing.
InputOtp
Separate boxes for a one-time code; accepts digits by default.
Kbd
A keyboard key, for shortcuts: Kbd::new("⌘K").
Keyed
Gives a view an explicit identity, like SwiftUI’s .id(): when the key changes, the view is treated as new (its local state and scroll position start over).
Label
A form label with an optional required marker and hint.
Labels
The words the built-in components use. Start from Labels::default (English) or Labels::pt_br, change what you need, and give it to Localized.
LightboxItem
One picture of an ImageLightbox.
Link
Text that opens an address when clicked or activated with the keyboard. #name scrolls to an anchor in the app.
Links
A shared handle to the links service, from crate::BuildCx::links or crate::Ui::links. An address that starts with # scrolls to the anchor of that name (crate::BuildCx::anchor) instead of leaving the app.
List
A bordered list; rows are separated by hairlines.
ListItem
A list row: leading icon or avatar, title, subtitle and trailing text.
LiveRunner
Runs the code of a Playground with the interpreter: its first function, which returns impl View, is called and shown. The program’s own use lines are read and left alone; what it does not read comes back as diagnostics with their place.
Localized
Everything inside uses these words instead of the English defaults: wrap the root of an app, or just the part that speaks another language.
LookupField
Picks a record from a list that is searched as you type, loaded from memory or through a callback that can go to a database or a server. Arrows move through the options, Enter picks and Escape closes. The chosen option can be cleared.
LookupItem
An option of a LookupField: the key the app knows it by, and the text people see.
LookupRequest
What a LookupField wants: up to limit options matching query.
LookupResponder
Delivers the answer to a LookupRequest, now or later on the UI thread. An answer to a search that was since replaced is ignored.
Lottie
Plays a Lottie animation, drawn with curves on the GPU, sharp at any size. It sleeps when it ends or is paused, so that an idle window stays idle. Where motion is reduced it shows its last frame, still.
LottieAnimation
A Lottie animation. Cloning is cheap, and it can be drawn at any moment.
Marquee
The animated outline of a selection, the “marching ants”: a dark line with light dashes walking over it, which reads over any picture. Give it a rectangle, a closed path or loose segments, such as the edges of a mask, in the units of the space.
MaskedField
A text input that follows a pattern, such as (00) 00000-0000, in which 0 is a digit, a a letter and * either; \ makes the next character plain. The binding holds only what was typed, without the pattern’s own characters, unless Self::keep_literals asks for them.
MemoryClipboard
A clipboard that lives only inside the app (tests, headless use).
MenuItem
One entry of a DropdownMenu or a ContextMenu. It can run an action, show a check mark, show any view, or open a submenu at its side.
Menubar
A horizontal bar of menus (File, Edit, View…).
Minimap
A small copy of the content with a rectangle around what is in view, linked to a ZoomPanView by the same ZoomView. A press or a drag moves the view there, and so do the arrow keys (with Shift, further).
ModelChoice
A model offered by a ModelPicker.
ModelPicker
A choice of local AI models, however many there are, to download, try, use and remove. It shows what it is given: deciding which models fit and doing the work is up to the app, or to ravenrs-ai.
ModelPickerLabels
The words a ModelPicker shows. English by default.
Motion
How a node animates. Attach it with BuildCx::motion.
MultiProgress
Several progress bars stacked, for work that has more than one part.
NinePointAnchor
A three by three grid for choosing a point of reference on a box. The arrow keys move it.
NoFilePicker
A picker that chooses nothing, for where there is no system to ask (tests, headless use).
NodeId
A node of the element tree produced by one build. Only valid during the build that created it.
NumberField
A typed number. While it has focus it shows what is being typed, and without focus the formatted value, such as R$ 1.234,50. Text that is not a number in range stays visible for fixing and leaves the value alone. Up and Down step.
OverlayBadge
A small view on a corner of another, such as a channel icon on an avatar or a count on a button. It sits centered on the corner, half outside.
PageHeader
The top of a page: its title, a line about it, badges beside the title and actions at the end.
PagedDocumentView
A bar with the page, the total and the zoom, over a column of pages of which only those that show are built, so the pictures of the others need not exist. Pictures come from whoever uses it, page by page: until one is ready, the page shows a placeholder of the right size. The fit follows the width of the view. Page Up, Page Down, Home and End move between pages, and +, - and 0 zoom.
Pagination
Page navigation: Previous, numbered pages with ellipses, Next.
PaintCx
What Paint::Rich draws with.
PickedFile
A file brought into the app, whole, in memory.
Playground
A place to write code and see what it makes, for documentation, tutorials and tools.
Popover
Floating content anchored to a view, open while open is true. Clicking outside or pressing Escape closes it. It opens below the view on a panel, unless told otherwise.
ProgressBar
A horizontal progress bar; value from 0.0 to 1.0. It can carry a label and a percentage above it and a detail below.
PropertyRow
A label on the left and its value on the right, for lists of properties.
Protractor
A band of ticks along an arc that sets an angle, by a drag from anywhere on it. A double click goes back to zero. The arrows change it by a step (with Shift, ten), Home and End go to the ends, and Delete goes back to zero.
QuadField
A plane of columns × rows squares drawn on every frame. At rest it lies like a floor that waves, lit in the accent and lifting under the pointer; as the scroll progresses through its ScrollRange it stands up and becomes the picture its function paints, one color per square. Nothing is rebuilt or laid out while it moves. Under reduced motion the floor stands still.
QuadPaint
A rounded rectangle painted behind an element’s children.
RadioGroup
One choice among several, shown as radio buttons. Arrow keys move the selection and the focus together (wrapping); Home and End jump to the ends.
Rating
Stars for a score, to read or to give.
RecurrenceEditor
Edits a RecurrenceRule: how often, every how many, on which weekdays and until when, and says in words what it chose. start is the first day, which the rule counts from.
RecurrenceRule
A repeating schedule, starting from a date given when asking for its days. A date past the end of a shorter month falls on that month’s last day and returns to its own day after: the 31st is February 28, then March 31.
ReleaseNote
What one version brought, for a ReleaseNotes.
ReleaseNotes
An app’s versions, newest first: the list on the left, what the chosen one brought on the right, and buttons that walk from one to the next.
Resource
A row of a Scheduler: a person, a room, a machine, an account.
Responsive
A view built from the viewport size; see responsive.
Ribbon
The ribbon.
RibbonGroup
A labeled set of commands inside a page.
RibbonItem
A command in a ribbon group: a button, a toggle, or a button with a menu.
RibbonPage
A tab of the ribbon.
RichText
Text with a little formatting, written the way chat apps write it: *bold*, _italic_, ~struck~, `code`, a fenced block of ```, lines that start with * , - or > , and web addresses, which become links.
RubberBand
A rectangle drawn with a drag, in the units of the content. The selection follows the drag through its binding, and on_select gets it on release; a press and release without moving clears it. Escape cancels a drag.
RuleOfThirdsGrid
A composition grid over a picture: thirds by default, or the other CompositionGuides. It takes no input, so what is underneath still gets the pointer.
Ruler
A horizontal or vertical ruler in the caller’s units. It picks a round step for the scale, so marks never crowd as the zoom changes. Numbers on a vertical ruler stack digit over digit, since text does not rotate.
RunOutput
What a Runner heard from the code since it was last asked.
SankeyChart
How much flows from what to what. Each flow names its two ends, and nodes are created as they are named. Ribbons go from the color of their source to that of their target; under the pointer or with the arrow keys, what is connected stands out and the tooltip says how much. A screen reader hears every flow.
Scheduler
A timeline of resources: a row for each person, room or account, a time axis across the top, and events as bars that can be dragged along the time and between rows, resized by their ends, and drawn on an empty stretch. Weekends are shaded, and only what is in view gets built, so large plans stay smooth.
SchedulerChange
An event moved, resized, or drawn for the first time: where it would now be.
SchedulerEvent
A bar on a Scheduler. One with no length shows as a milestone.
SchedulerRange
A shaded stretch of time across all rows, such as a holiday or a deadline.
ScrollEdgeArrow
A strip that scrolls, with an arrow over a fade at each end that has more to show. The arrow scrolls most of the strip at a time, and leaves when that end is reached.
ScrollLink
Turns scroll progress into an Effect: opacity, movement and scale.
ScrollLinked
Paints its content with the effect a ScrollLink gives for the current scroll position. Like the effects of crate::Motion, it changes how the content looks, not its layout or where it is clicked.
ScrollScene
A section that holds its content on screen for length pixels of scrolling: the stage for steps that change as the reader scrolls. Inside it, ScrollLinked views measure ScrollRange::Scene, from 0 when the content pins to 1 when the scene lets go.
ScrollView
A vertically scrolling stack. It fills the space its parent gives it (or height) and scrolls its children with the wheel or trackpad, showing a thin scrollbar while they move.
Section
A titled group of content with an optional description, and actions at the end of its header.
SegmentedControl
A row of mutually exclusive segments, like a compact tab bar. Arrow keys move the selection and the focus together (wrapping); Home and End jump to the ends.
Select
Picks one option from a list, shown in a field-like trigger. Enter, Space or an arrow key opens the list with the current option focused; arrows move, Enter picks, Escape closes, and focus returns to the field.
SelectionBar
A bar for what to do with several things chosen at once: how many, a way out and the actions, which are disabled while nothing is chosen. Escape also leaves. It goes where the field to write in was, or over a list; the app decides when it shows.
Semantics
How a node appears to screen readers: its Role, name and state.
Sheet
A panel that slides over the UI from one edge, over a dimmed backdrop.
ShimmerText
One line of text with a light passing over it, to say that something is under way.
ShortcutHintBar
A line of key hints under what they act on: ← → move · 1–5 rate.
ShortcutSheet
A dialog listing the keys of a screen, in groups. Escape, the backdrop and its X close it.
Sidebar
A navigation column: Sidebar::new((SidebarSection::new("Workspace"), SidebarItem::new(...), ...)).
SidebarBrand
The name of an app at the top of a Sidebar, with its mark. Reduced to icons, only the mark stays, in line with the icons.
SidebarGroup
A titled set of sidebar items that can fold away and carry actions.
SidebarInset
The page beside a SidebarVariant::Inset sidebar: a raised surface that takes the remaining room.
SidebarItem
A sidebar row with an icon, a label, an optional count or badge, actions and a submenu.
SidebarParts
What Sidebar::state, Sidebar::header and Sidebar::footer add to a sidebar. Its own type parameter, so a sidebar without them stays Send.
SidebarSection
A small caption that groups sidebar items. Reduced to icons, it is a hairline.
SidebarSkeleton
Placeholder rows while a sidebar’s items load.
SidebarState
Whether a Sidebar is open, shared with whatever toggles it.
SidebarTrigger
A button that opens and closes a Sidebar, sharing its SidebarState.
Silence
A provider that makes no sound (tests, headless use).
Skeleton
A placeholder block shown while content loads.
Slider
A draggable value between min and max. Arrow keys adjust it by step.
SortableList
A list that reorders by dragging a row, with a line showing where it will land, or with Alt and the arrows, Home and End. The arrows alone move between rows, and each move is announced to screen readers. The order belongs to the app, which applies what on_reorder tells it.
Sound
A shared handle to the sound system, from crate::BuildCx::sound or crate::Ui::sound.
SoundClip
A short sound in memory: one channel, ready to be played many times. Cloning shares the samples.
Spacer
Flexible empty space that pushes its siblings apart inside a stack.
Spinner
An indeterminate activity indicator. With reduced motion it is static.
SplashScreen
The opening screen that covers the window while the app loads: a logo or icon, the app’s name, a status message and its progress.
SplitButton
A button with a main command and, beside it, a menu of alternatives, such as Save, with Save and Close and Save and New.
SplitHandle
A bar to drag that changes a size, for a pane an app lays out itself, such as a strip along the bottom of a window. Arrow keys move it too, Shift goes further, and Home and End go to the limits. SplitPanes is built on it.
SplitPane
One pane of a SplitPanes.
SplitPanes
Any number of panes side by side or stacked, with a bar to drag between each two. Panes can have limits, and the sizes can be kept by the app to remember them.
Splitter
Two panes with a draggable divider between them. Arrow keys move the divider too. For more panes, or limits in logical pixels, see SplitPanes.
Stat
A headline number with a label and an optional change indicator.
StatusBar
The one line at the foot of an app window that is always there: the version, what is going on in the background, a notice with its actions.
StepBadge
The round mark of a step by itself: its number, a check mark when done, or an alert when it has a problem. For a list of steps, see StepIndicator.
StepIndicator
Where a task in steps stands, for an app that lays out the steps itself. A Wizard has its own row of these.
Stepper
Decrement / value / increment, for small integer quantities. When focused, arrow keys step by one and Home / End jump to the limits.
Sticky
Keeps its content on screen while its parent scrolls past, like CSS position: sticky: it stays top pixels below the top of the scroll container and leaves with the bottom of its parent.
Styled
A view wrapped in a box with layout and background modifiers; see ViewExt.
SwatchGrid
A grid of ColorSwatches. The arrow keys walk through it, and the handler gets the keys held with the click, so that a modifier can mean something else, such as “for the background”.
Table
A simple data table with a header, hover-highlighted rows and numeric columns.
Tabs
A tab bar with one content view per tab; only the selected one is built. Arrow keys move between tabs and open them; Home and End jump to the ends.
TagBox
Picks several values from a list, showing each as a tag with a button to take it off. The list searches as you type; Enter picks or takes off the highlighted option, Backspace on the empty search takes off the last tag, Escape closes.
Text
Text in the theme’s type scale. It wraps to the width its container offers.
TextArea
A multi-line text input bound to a String. Enter starts a new line, the arrows move between lines, and it scrolls past Self::rows lines.
TextField
A single-line text input bound to a String.
ThemeEditor
Changes the tokens of the theme on screen, which follows at once: colors, the radii and the sizes of text. It warns when text stops being legible on its ground, and copies what changed as JSON, or takes it back, so an application can keep it wherever it wants.
ThemePicker
A menu of themes that says which one is on, small enough for a sidebar’s footer or a toolbar. For the three of them side by side, in a settings page, see ThemeSwitcher.
ThemeSwitcher
Switches the app between its dark, light and glass themes: Raven Dark, Raven Light and Raven Glass, unless the app has its own.
Ticker
Repeats its content in a strip that keeps moving sideways, for logos, quotes or samples of components. It moves on the GPU’s clock without rebuilding, and stands still under reduced motion.
Tile
One tile of a TileLayout.
TileLayout
A dashboard: tiles in a grid of cells, that people can drag to another place and resize. As the width falls, it uses fewer columns. From the keyboard, on a tile’s handle: arrows move it, Shift with arrows resizes it.
TileSpot
Where a tile stands: which tile, and how many cells it takes. The order of a list of these is the order on the screen.
Time
A time of day, with no date or time zone.
TimeAxis
The stretch of time a Scheduler shows, how wide it is and how it is marked.
TimeLink
Turns the clock (seconds) and an element’s frame into an Effect, worked out on every painted frame while the element shows. See BuildCx::time_linked.
TimePicker
A 24-hour time field: type it, or choose from a list in steps of Self::step_minutes.
TimePoint
A moment on a calendar, to the minute, with no time zone.
Timeline
Things along time, on named tracks, under a ruler with markers and a playhead.
TimelineItem
One block on a TimelineTrack.
TimelineMarker
A named moment, on the ruler of a Timeline.
TimelineTrack
A row of a Timeline.
TitleBar
A title bar drawn by the app: what comes first, the title, the actions and the buttons of the window. A button shows only when it has a handler. A double click on the bar does the same as the maximize button.
Toast
One notification in a Toaster.
ToastExtras
What a toast can do besides showing: a button, something to run once it is gone, and a place of its own.
Toaster
Displays Toasts stacked in a corner of the window, the bottom-right one unless told otherwise; each disappears after its duration or when closed.
Toasts
A handle to show toasts from anywhere (event handlers, async tasks). Place one Toaster in the UI to display them.
Toggle
An on/off switch.
ToggleButton
A button that stays pressed: bold, italic, “pin”, “mute”.
ToggleGroup
A row of toggle buttons where one (or several) can be on. Arrow keys move the focus between buttons; Space or Enter toggles the focused one.
ToolRail
A narrow bar of tools with their names under their icons, of which one is open: what sits along the side of an editor, with the open tool’s panel next to it.
ToolRailItem
One place of a ToolRail: a tool, and the others that can take its place.
Toolbar
A row of commands. What does not fit moves to a menu at its end, from the last command back, so the order never changes.
ToolbarAction
One command of a Toolbar.
Tooltip
Shows a short label above its content while the pointer is over it, with the key that does the same when there is one.
TransformHandles
Eight handles around a box, one that turns it and the point it turns around, drawn over content in the units of a ContentSpace. It edits a BoxTransform and draws nothing but the box: the renderer cannot turn a picture, so applying the geometry is up to whoever owns it.
TreeNode
One item of a TreeView, with the items under it.
TreeView
A list of items that open to show more items: a chooser, a menu of a module, the structure of a document. Arrows move and open, Enter opens the item, Space checks it or selects it. With a height, only the visible lines are built.
Ui
The platform-independent UI runtime: owns the root view, reacts to input and state changes, and produces a Scene for the renderer.
UiStats
Work a Ui has done since it was created. These are exact counts, so a test can demand that moving the pointer shapes no text or that an animation builds nothing.
UiWaker
Rebuilds the UI from any thread, when background work has something to show.
VStack
Arranges children top to bottom.
ValueSlider
A value shown small, as “100% ▾”, that opens a Slider in a popover, for bars with no room for a slider of their own.
VirtualList
A list of any length that builds only the rows that show, with rows of any height. They are laid out and measured as they appear, and what was measured is kept by key, so going back finds them at the right size. It can jump to a row, stay at the end as a chat does, and keep what is on screen still when rows come in above it. With nothing to select, the arrows, Page Up, Page Down, Home and End scroll; with a selection or on_activate, they move between rows, and Enter or Space activates.
WidgetId
Stable identity of a widget across rebuilds, derived from its position in the view tree (or from an explicit key, see BuildCx::keyed_child). Hover, press and focus are remembered per WidgetId.
Wizard
A task in steps: where it stands at the top, one step on the screen, and buttons to go on. A step can refuse to be left, and steps already done can be reopened.
WizardStep
One step of a Wizard.
YearView
The twelve months of a year, with a dot on the days that have something and a click on any of them. As many months go on a line as fit. From the keyboard the year is one Tab stop: arrows move by day and week, Home and End to the ends of the week, Page Up and Page Down by month, and Enter or Space picks.
ZStack
Views on top of each other, the later ones above, in a box as large as the largest.
ZoomControl
Fit, 1:1, the current percentage and the buttons that zoom in and out, for a ZoomView. It works from a toolbar of its own or inside a FloatingToolbar.
ZoomPanPaint
Where drawn content goes, for ZoomPanView::custom and Minimap::custom.
ZoomPanView
Zoom and pan over content: pinch or Cmd/Ctrl with the wheel to zoom, a drag or the wheel to move, a double click between fit and 100%, and the keys +, -, 0, 1 and the arrows (with Shift, further). A thrown drag coasts to a stop, which asks for frames only meanwhile and never happens with reduced motion. The content cannot leave the view.
ZoomView
How a picture is being looked at: how much it is enlarged and which part is in the middle. ZoomPanView, ZoomControl and Minimap share one through a Binding, and each changes what it is responsible for.

Enums§

AnchorPoint
One of the nine points of a NinePointAnchor.
BoxHandle
One of the eight handles of a TransformHandles.
ButtonSize
Height and horizontal padding of a Button.
ButtonStyle
Visual emphasis of a Button or other control.
ChartBarFrom
Where the bars of a Chart grow from.
ChartCurve
How a line goes from one point to the next.
ChartGrid
Which gridlines a chart has, as they look on the screen.
ChartIndicator
How a row of a ChartTooltip shows its color.
ChartKind
The kind of a chart.
ChartLabelAt
Where a label sits relative to what it names.
ChartLegend
Where a Chart’s legend goes.
ChartPolarGrid
The shape of the grid of a radar or radial chart.
ChartStack
How series share the same category.
ChatAuthor
Who wrote a ChatMessage.
CodeLanguage
The language a CodeEditor colors.
CompareMode
How a CompareView shows its two pictures.
CompareSide
One of the two pictures of a CompareView.
CompositionGuide
The lines a RuleOfThirdsGrid draws.
ContentMode
How an image fills its frame when their aspect ratios differ.
ContentSpace
How the coordinates of a widget drawn over content relate to the screen, so that a selection or a crop is told in the units of the content whatever the zoom.
DockDrop
Where a panel is sent by DockLayout::move_panel. Places are named by a panel that is there, since the id of a panel is what stays the same as the tree changes around it.
DockEdge
A side of a group of tabs, where a split opens.
DockLayoutError
Why a saved text could not be read. Nothing was changed; the app goes on with the arrangement it has, or the one it starts from.
DockNode
A part of the tree: tabs, or parts side by side or stacked.
DockSide
One of the four places a DockArea has.
DockTabBar
When a group of a DockArea shows its tabs.
DragPhase
Phase of a pointer drag that started on an element.
FileSortColumn
What a FileBrowser sorts by.
Fill
A color given either as a theme role (preferred, follows theme changes) or as a literal color.
FilterFieldKind
What a field of a FilterBuilder holds, which says how its values are written.
FloatingCorner
A corner of the window, where a FloatingPanel rests.
Frequency
How often a RecurrenceRule comes back.
HistogramScale
How a Histogram turns counts into heights.
IconName
Icons available to Icon, from the Lucide set.
LottieError
Why a file could not be read.
ModelStatus
Where a ModelChoice stands.
Paint
What an element draws before its children.
Placement
Where an overlay is placed relative to its anchor.
RecurrenceEnd
When a RecurrenceRule stops.
RibbonSize
How much room a ribbon command takes.
SankeyAlign
Which column a node goes to, among those its flows allow.
ScrollRange
Which stretch of scrolling a ScrollLink counts as going from 0 to 1.
Side
The edge a Sheet slides in from.
SidebarCollapse
What a Sidebar does when it closes.
SidebarVariant
How a Sidebar sits next to the page.
StepState
Where a step of a task stands.
Symbology
A barcode format.
TabsVariant
How a Tabs bar looks.
TimeScale
What one tick of a TimeAxis is.
TimelineEdit
What someone did to a block, for the app to apply.
ToastPosition
Where in the window a Toaster stacks its toasts.
Tone
Tone of a badge or alert. Status tones always come with a word or an icon, never color alone.
UiActivity
What just happened in the UI, for something watching it as a whole.

Traits§

ClipboardProvider
Reads and writes the system clipboard. Platform layers install one with crate::Ui::set_clipboard; until then, an in-memory clipboard is used.
Component
A component composed from other views, SwiftUI style.
FilePickerProvider
Asks the person for files. Platform layers install one with crate::Ui::set_file_picker.
FullScreenProvider
Puts the app in full screen and takes it out. Platform layers install one with crate::Ui::set_full_screen: the browser asks for the page’s full screen, the desktop turns the window into a borderless full screen.
LinkOpener
Opens an address outside the app. Platform layers install one with crate::Ui::set_links: the browser navigates, the desktop asks the system’s browser.
Runner
What turns the code of a Playground into something to show.
SoundProvider
Plays sounds and speaks. Platform layers install one with crate::Ui::set_sound; until then, nothing is heard.
View
Anything that can appear in the UI.
ViewExt
SwiftUI-style modifiers available on every view.
ViewSeq
An ordered collection of child views: tuples of up to 12 views, Vec<V> and Vec<AnyView>.

Functions§

days_in_month
Number of days in month (1–12) of year.
decode_image
Decodes PNG or JPEG bytes into RGBA pixels.
highlight_rust
The colored stretches of Rust code, as char indices. It reads tokens, not syntax, so it never fails: unfinished strings and comments color to the end.
is_leap_year
Whether year has a February 29 (Gregorian rules).
live_registry
Everything the interpreter can reach in the components and the crates under them.
responsive
Builds a view from the viewport size (in logical pixels), like SwiftUI’s GeometryReader: use it to switch layouts at breakpoints.
view_fn
Wraps a closure as a view. Whatever state the closure reads is tracked, so this is the simplest way to make a region of the UI depend on state:

Type Aliases§

ActivityObserver
Receives what happens in the UI, with the clock; see BuildCx::observe_activity.
AnyView
A type-erased view, for heterogeneous lists and dynamic UI.
DragHandler
Called for each phase of a pointer drag on an element.
DrawFn
Custom drawing callback: receives the element’s absolute frame in logical pixels.
KeyHandler
Called with the focused element’s key presses; returns true when it handled the key.
LiveFn
Drawing that changes over time: receives the element’s frame and the clock in seconds. It runs on paint-only frames, at most 60 times a second, for as long as the view is built. With reduced motion it runs once, at time zero.
RichFn
Draws a node with PaintCx, given its absolute frame.
Rule
A validation rule: Ok(()) or a message for the user.