Skip to content
  1. Docs
  2. enzUI framework
  3. Developers

Widget catalog

Every widget in the gallery, as it renders in the dark theme.

Captured from cargo run -p enzui-widgets --example gallery. Each picture is the widget's live preview with its default settings; open the gallery to try the controls and copy the code. Jump to a group:

Buttons and actions

ENZUI_GALLERY_PAGE=Buttons

  • enz_filter_chip in the widget galleryenz_filter_chipA toggle that filters a list; it shows whether it is on.
  • enz_toolbar_icon in the widget galleryenz_toolbar_iconAn icon button for a toolbar or titlebar. Its label is required: it names the button for screen readers and shows as its tooltip.
  • enz_key_badge in the widget galleryenz_key_badgeA keyboard key, for shortcut hints, one badge per key. Keys with a well-known symbol (Shift, Enter, Tab, Backspace, Space, arrows, Command, Option) draw it; screen readers still hear the name.
  • enz_tooltip in the widget galleryenz_tooltipWraps any widget with a hint that fades in on hover. Hover the button.
  • enz_link in the widget galleryenz_linkInline text that opens a URL or runs an action.
  • ButtonKind in the widget galleryButtonKindEvery kind side by side: the filled kinds lead, the outlined and flat ones step back, and the danger ones say what they do.
  • enz_button in the widget galleryenz_buttonRuns an action. The kind says how much it matters; the size follows the surrounding controls. Buttons are flat, set apart by their fill; the theme's elevation.button level (0 by default) lifts the filled kinds with a faint shadow.
  • enz_button_group in the widget galleryenz_button_groupA segmented control: one choice out of a few, side by side. A single choice is a thumb inside a track; a set of toggles is tinted.

Text input and forms

ENZUI_GALLERY_PAGE=Input

  • RichEditor::view in the widget galleryRichEditor::viewFormatted text: bold, italic, lists and links, with its own toolbar. The editor owns its document; the view renders it.
  • enz_text_field in the widget galleryenz_text_fieldOne line of text with a label above it. A description explains it; an error replaces the description and colours the border.
  • enz_secure_field in the widget galleryenz_secure_fieldA password field. The eye button shows the text; copying out of it is refused.
  • enz_search_field in the widget galleryenz_search_fieldA search box with a magnifier and a clear button.
  • enz_toggle in the widget galleryenz_toggleAn on/off switch for a setting that applies at once.
  • enz_checkbox in the widget galleryenz_checkboxA yes/no choice. A parent shows the mixed state while only some of its children are on.
  • enz_radio_group in the widget galleryenz_radio_groupOne choice out of a short list, all visible at once.
  • enz_slider in the widget galleryenz_sliderA value in a range, set by dragging or with the arrow keys. A step snaps it; marks show the steps.
  • enz_range_slider in the widget galleryenz_range_sliderA low and a high value in one track, for a price or date range.
  • enz_stepper in the widget galleryenz_stepperA number with minus and plus buttons: whole (i32, u32) or decimal (f32, f64), which keeps the places its step needs. Click the value to type one; Enter or clicking away commits, Escape cancels.
  • enz_chip_input in the widget galleryenz_chip_inputA list of short values typed into one field: Enter or a comma makes a chip, Backspace removes the last.
  • enz_input_otp in the widget galleryenz_input_otpA one-time code, one cell per character, grouped for reading.
  • enz_rating_input in the widget galleryenz_rating_inputA star rating the user sets by clicking or with the arrow keys.

Selection and pickers

ENZUI_GALLERY_PAGE=Selection

  • enz_combo_box in the widget galleryenz_combo_boxA dropdown: one choice out of a long list. Searchable filters the list as you type.
  • enz_radio_button in the widget galleryenz_radio_buttonA single radio option, for laying out choices yourself; all options share one selected value.
  • enz_time_picker in the widget galleryenz_time_pickerA time of day: type it, or pick from a list at a fixed interval.
  • enz_preferences_group + enz_preferences_row in the widget galleryenz_preferences_group + enz_preferences_rowA settings list: each row has a title, an optional subtitle and a control on the right.

Date, colour and emoji

ENZUI_GALLERY_PAGE=Pickers

  • enz_date_picker in the widget galleryenz_date_pickerA date field that opens a month calendar. The state keeps the open month and the bounds.
  • enz_color_picker in the widget galleryenz_color_pickerPicks a colour on a saturation plane and a hue strip, or as hex.
  • enz_color_swatch in the widget galleryenz_color_swatchOne preset colour to click. The selected swatch shows a ring.
  • enz_emoji_picker in the widget galleryenz_emoji_pickerSearchable emoji in categories, with the recently used first.

Feedback and progress

ENZUI_GALLERY_PAGE=Feedback

  • enz_progress_text in the widget galleryenz_progress_textA short status line with a working indicator, for work without a known length.
  • enz_animated_image in the widget galleryenz_animated_imageA GIF or APNG played on its own frame delays; it holds still with reduced motion or when paused.
  • enz_banner in the widget galleryenz_bannerA message across the top of a page or pane, with an optional action. The tone sets its colour and icon.
  • enz_progress_bar in the widget galleryenz_progress_barHow far a task has got, from 0.0 to 1.0. The fill glides to each new value.
  • enz_spinner in the widget galleryenz_spinnerWork in progress with no known length. It turns on the compositor, so it costs the app no frames.
  • enz_gauge in the widget galleryenz_gaugeA value as a ring, for a level or a share. It sweeps to each new value; drag the progress slider above.
  • enz_status_dot in the widget galleryenz_status_dotA small coloured dot for a state: online, failing, running. It can breathe or ripple for a live state.
  • enz_badge in the widget galleryenz_badgeA short label or count beside something else.
  • enz_avatar in the widget galleryenz_avatarA person's picture, or their initials when there is none.
  • enz_skeleton in the widget galleryenz_skeletonA placeholder in the shape of content that is still loading. It pulses unless motion is reduced.
  • enz_toast in the widget galleryenz_toastA brief message about something that just happened. Shown here inline; an app stacks them in a toast host over its window.
  • enz_rating in the widget galleryenz_ratingA read-only star rating; halves show as half stars.
  • enz_status_page in the widget galleryenz_status_pageFills an empty or failed view with an icon, a title, a line of help and an optional action.

Charts

ENZUI_GALLERY_PAGE=Charts

  • enz_line_chart in the widget galleryenz_line_chartValues over a continuous axis; each Series is one line.
  • enz_bar_chart in the widget galleryenz_bar_chartValues by category. Click a bar to select it.
  • enz_area_chart in the widget galleryenz_area_chartA line chart filled down to the axis, for amounts that add up over time.
  • enz_pie_chart in the widget galleryenz_pie_chartShares of a whole. A donut ratio cuts out the middle.
  • enz_scatter_chart in the widget galleryenz_scatter_chartPoints on two axes, to show how two values relate.
  • enz_sparkline in the widget galleryenz_sparklineA tiny trend line without axes, to sit beside a number or in a table cell.

Tables and lists

ENZUI_GALLERY_PAGE=Data

  • enz_table in the widget galleryenz_tableA virtualised table: only the visible rows are built, so 500 rows cost as much as 10. Click a header to sort, drag its edge to resize, click a row to select it.
  • enz_notification_inbox in the widget galleryenz_notification_inboxA list of notifications with read state, grouping and dismissal. The core Inbox holds them; apply() updates it.
  • enz_tree_view in the widget galleryenz_tree_viewNested rows that open and close. The app keeps which branches are open and passes the visible rows, each with its depth.

Text and content

ENZUI_GALLERY_PAGE=Content

  • enz_markdown in the widget galleryenz_markdownRenders Markdown: headings, emphasis, code, lists, quotes and links.
  • enz_code_block in the widget galleryenz_code_blockSource code with highlighting and a copy button, like the code under every specimen here.
  • enz_chat_bubble in the widget galleryenz_chat_bubbleOne message in a conversation. The role puts it on the right side and colours it.
  • enz_media_controls in the widget galleryenz_media_controlsPlay, seek and volume for audio or video. It shows a media Snapshot and sends a message per action.
  • enz_labeled_content in the widget galleryenz_labeled_contentA label and its value on one row, for read-only details.
  • enz_divider in the widget galleryenz_dividerA line between groups, optionally with a word in the middle.
  • enz_preview_row in the widget galleryenz_preview_rowA list row with a title and a clipped excerpt, as in a mail or notes list: an avatar or icon before it, a time after the title, and an unread dot.

Containers and surfaces

ENZUI_GALLERY_PAGE=Containers

  • enz_card in the widget galleryenz_cardA surface that groups related content under an optional title.
  • enz_group_box in the widget galleryenz_group_boxA titled frame around a few related controls.
  • enz_section_header in the widget galleryenz_section_headerA heading that starts a section of a list or page.
  • enz_header_bar in the widget galleryenz_header_barThe title row at the top of a pane, with optional back button and actions.
  • enz_status_bar_strip in the widget galleryenz_status_bar_stripA strip along the bottom of a window or pane, with items at both ends.

Layouts

ENZUI_GALLERY_PAGE=Layouts

  • enz_responsive_grid in the widget galleryenz_responsive_gridCells in columns that follow the width: three here, one on a phone. Resize the window to see it.
  • enz_flow in the widget galleryenz_flowItems in a row that wraps onto new lines, like words in a paragraph.
  • enz_carousel in the widget galleryenz_carouselPages one at a time, with indicators, arrow keys and swipe. Each page is built only when shown.

Materials and depth

ENZUI_GALLERY_PAGE=Materials

  • enz_glass in the widget galleryenz_glassA material that samples what is behind it: refraction at the rim, frost and tint over a busy background. The style picks how much it hides.
  • enz_gradient_background in the widget galleryenz_gradient_backgroundA linear gradient of two or three colours behind any content; the glass above sits on one.
  • enz_elevation in the widget galleryenz_elevationLifts content off the page with a shadow, from level 0 (flat) to 5.
  • grain in the widget gallerygrainA paper-like speckle on any surface: enz_surface(..).grain(..), a shell pane's PaneStyle::grain, or enz_grain around anything. The built-in grain is a seamless noise tile rasterised once per screen scale; any SVG can be a grain too. GrainSpec::Theme follows the theme's own grain.

Animation and motion

ENZUI_GALLERY_PAGE=Motion

  • Built-in widget motion in the widget galleryBuilt-in widget motionEvery control animates its own state changes on the theme's motion scale: hover a button, focus a field, check a box, or change the values. Reduce motion makes every change land at once, as the theme's reduced_motion does for a whole app.
  • animated(..).spring(..) in the widget galleryanimated(..).spring(..)Each dot runs on a different spring. Press the button again mid-flight: every dot turns around with the speed it had. The app only sets the target; the widget animates without frame messages.
  • SpringAnimation in the widget gallerySpringAnimationDrag the card and let go: it carries your speed to the nearer side. Catch it mid-flight. The app owns the spring and reads its value each frame.

Images and SVG

ENZUI_GALLERY_PAGE=Images

  • enz_animated_image in the widget galleryenz_animated_imageA GIF or APNG played on its own frame delays; it holds still with reduced motion or when paused.
  • enz_image_handle in the widget galleryenz_image_handleA raster picture. The fit says how it fills its box when the shapes differ; the box here is 140 px tall.
  • enz_svg in the widget galleryenz_svgA vector picture that stays sharp at any size. A symbolic one takes the text colour, so it follows the theme.
  • enz_animated_svg in the widget galleryenz_animated_svgSVG with SMIL and CSS animation. Each picture redraws only when it changes, and stops when hidden or paused. The last square starts when clicked.

Overlays and dialogs

ENZUI_GALLERY_PAGE=Dialogs

  • enz_menu_button in the widget galleryenz_menu_buttonA button that opens a menu of commands. The core MenuModel lists them; apply_event() tracks the open state.
  • enz_popover in the widget galleryenz_popoverFloating content anchored to a trigger, closed by Escape or a click outside. The app says whether it is open.
  • enz_about_dialog in the widget galleryenz_about_dialogThe standard About window: name, version, credits, licence and links. It hosts itself over the page while open.
  • enz_confirm_dialog in the widget galleryenz_confirm_dialogAsks before an action that cannot be undone. A destructive one colours the confirm button.