Skip to main content

Crate herogpui_components

Crate herogpui_components 

Source
Expand description

HeroGPUI components — a faithful Rust/GPUI port of the HeroUI v3 component library. One module per @heroui/* package.

Every component and builder type is #[must_use]: a builder that is built and then dropped renders nothing, so the compiler says so.

ⓘ
#![deny(unused_must_use)]
Button::new("save").label("Save"); // dropped: `unused_must_use` fires

The same statement, used:

#![deny(unused_must_use)]
Button::new("save").label("Save")

Re-exports§

pub use traits::Disableable;
pub use traits::Selectable;
pub use traits::Sizable;
pub use accordion::*;
pub use alert::*;
pub use alert_dialog::*;
pub use assets::*;
pub use autocomplete::*;
pub use avatar::*;
pub use avatar_group::*;
pub use badge::*;
pub use breadcrumbs::*;
pub use button::*;
pub use button_group::*;
pub use calendar::*;
pub use calendar_view::*;
pub use card::*;
pub use checkbox::*;
pub use chip::*;
pub use close_button::*;
pub use color_picker::*;
pub use combo_box::*;
pub use command_palette::*;
pub use context_menu::*;
pub use date_constraints::*;
pub use date_picker::*;
pub use disclosure::*;
pub use drawer::*;
pub use dropdown::*;
pub use field::*;
pub use filter::*;
pub use form::*;
pub use hover_card::*;
pub use icon::*;
pub use icons::*;
pub use input::*;
pub use input_group::*;
pub use input_otp::*;
pub use kbd::*;
pub use link::*;
pub use list_box::*;
pub use menu_bar::*;
pub use meter::*;
pub use modal::*;
pub use number_field::*;
pub use pagination::*;
pub use picker_item::*;
pub use popover::*;
pub use progress::*;
pub use radio_group::*;
pub use range_calendar::*;
pub use resizable::*;
pub use scroll_shadow::*;
pub use scrollbar::*;
pub use select::*;
pub use selection::*;
pub use separator::*;
pub use sidebar::*;
pub use skeleton::*;
pub use slider::*;
pub use spinner::*;
pub use surface::*;
pub use switch::*;
pub use table::*;
pub use tabs::*;
pub use tag_group::*;
pub use textarea::*;
pub use time_field::*;
pub use title_bar::*;
pub use toast::*;
pub use toggle_button::*;
pub use toolbar::*;
pub use tooltip::*;
pub use tree_view::*;
pub use typography::*;
pub use validation::*;
pub use virtual_list::*;

Modules§

a11y
What each control tells assistive technology, stated once per control.
accordion
Accordion — port of @heroui/accordion.
alert
Alert — port of @heroui/alert.
alert_dialog
AlertDialog — port of @heroui/alert-dialog (v3).
anim
Motion primitives shared by every animated component.
assets
Embedded assets: the SVGs HeroGPUI’s built-in component chrome draws (every path in icons) and the Lucide set named by IconName.
autocomplete
Autocomplete — port of @heroui/autocomplete.
avatar
Avatar — port of @heroui/avatar (v3.2.6, Radix Avatar 1.2.6 semantics).
avatar_group
AvatarGroup — port of @heroui/react v3.2.6 AvatarGroup and AvatarGroup.Count (avatar-group/avatar-group.tsx, styles/components/avatar-group.css).
badge
Badge — port of @heroui/badge.
breadcrumbs
Breadcrumbs — port of @heroui/breadcrumbs.
button
Button — port of @heroui/button (v3).
button_group
ButtonGroup — port of @heroui/button-group (v3).
calendar
Calendar & RangeCalendar — port of @heroui/calendar and @heroui/date-picker’s range grid (std-only date math).
calendar_system
The calendar system a month grid is drawn in.
calendar_view
The v3 calendar view model: visibleDuration, pageBehavior and selectionAlignment.
card
Card — port of @heroui/card.
checkbox
Checkbox — port of @heroui/checkbox.
chip
Chip — port of @heroui/chip.
close_button
CloseButton — port of @heroui/close-button.
color_picker
Colors — port of @heroui/color-area, color-field, color-picker, color-slider, color-swatch and color-swatch-picker (v3).
combo_box
ComboBox — port of @heroui/combo-box (v3).
command_palette
CommandPalette — a modal command search (HeroGPUI extension; HeroUI v3 has no command palette).
context_menu
ContextMenu — a right-click menu over an area (HeroGPUI extension; HeroUI v3 has no context menu, only the trigger-anchored Dropdown).
date_constraints
The date constraints v3 puts on every date component.
date_picker
DatePicker, DateRangePicker & DateField — port of the v3 @heroui/date-picker family: a popover calendar plus ISO text entry.
disclosure
Disclosure & DisclosureGroup — HeroUI v3 Disclosure.
drawer
Drawer — port of @heroui/drawer.
dropdown
Dropdown & Menu — port of @heroui/dropdown, @heroui/menu and @heroui/listbox.
extend
The helpers HeroGPUI supports for building custom widgets that match the components: v3’s radius scale read from the active theme, the field metrics, the interactive cursor, the focus-visible modality, and the vanilla-GPUI workarounds the components themselves use.
field
Form field primitives — port of @heroui/label, @heroui/description, @heroui/error-message, @heroui/field-error and @heroui/fieldset.
filter
useFilter — the string matchers v3 hands an Autocomplete or a ComboBox.
form
Form — port of @heroui/form (v3).
gallery_source
Component source embedded only for the installable gallery’s generic API reference fallback.
hover_card
HoverCard — a rich preview card opened by hovering or focusing a trigger (HeroGPUI extension; HeroUI v3 has no hover card, and React Aria has no hook for one).
i18n
Localizable component chrome strings (HeroGPUI extension).
icon
A named, embedded Lucide icon set (HeroGPUI extension, not a HeroUI v3 API).
icons
Icon asset paths used by HeroGPUI components.
input
Input & InputState — port of @heroui/input.
input_group
InputGroup — port of @heroui/input-group (v3).
input_otp
InputOTP — port of @heroui/input-otp.
kbd
Kbd — port of @heroui/kbd.
link
Link — port of @heroui/link (v3).
list_box
ListBox — port of @heroui/list-box (v3).
list_nav
Arrow-key navigation shared by every list-shaped control.
menu_bar
MenuBar — a horizontal application menu bar (HeroGPUI extension; HeroUI v3 has no menu bar, only the trigger-anchored Dropdown).
meter
Meter — HeroUI v3 Meter (value within a known range).
modal
Modal — port of @heroui/modal.
number_field
NumberField — port of @heroui/number-field (v3).
pagination
Pagination — port of @heroui/pagination.
picker_item
The shared keyed item for the pickers.
popover
Popover — port of @heroui/popover.
progress
ProgressBar / ProgressCircle — port of @heroui/progress.
radio_group
RadioGroup — port of @heroui/radio.
range_calendar
RangeCalendar — port of @heroui/range-calendar (v3).
resizable
ResizablePanelGroup and ResizablePanel — split panels with a drag handle between each pair (HeroGPUI extension; HeroUI v3 has no resizable or split-view component).
scroll_shadow
ScrollShadow — port of @heroui/scroll-shadow (v3).
scrollbar
Painted scrollbar — the GPUI stand-in for HeroUI’s CSS scrollbar token.
select
Select — port of @heroui/select with single and multiple selection.
selection
The shared selectionMode semantics.
separator
Separator — port of @heroui/separator (v3, formerly Divider).
sidebar
Sidebar — a collapsible application sidebar (HeroGPUI extension; HeroUI v3 has no sidebar). The API follows gpui-kit’s Sidebar and shadcn/ui’s sidebar: a header, groups of menu items under optional labels, and a footer.
skeleton
Skeleton — port of @heroui/skeleton (v3).
slider
Slider — port of @heroui/slider (single or multi-thumb).
spinner
Spinner — port of @heroui/spinner (v3).
surface
Surface — port of @heroui/surface.
switch
Switch — port of @heroui/switch.
table
Table — port of @heroui/table (v3).
tabs
Tabs — port of @heroui/tabs.
tag_group
TagGroup — port of @heroui/tag-group (v3).
textarea
TextArea — port of @heroui/text-area (v3).
time_field
TimeField — port of @heroui/time-field (v3).
title_bar
TitleBar and WindowBorder — custom window chrome for frameless windows (HeroGPUI extension; HeroUI v3 is a web library and has no window chrome). The platform split follows gpui-kit’s title_bar.rs and window_border.rs, checked against the pinned gpui-pre 0.3.5 platform sources.
toast
Toast — port of @heroui/toast (v3).
toggle_button
ToggleButton & ToggleButtonGroup — port of @heroui/toggle-button v3.
toolbar
Toolbar — port of @heroui/toolbar.
tooltip
Tooltip — port of @heroui/tooltip (v3).
traits
Shared builder traits (HeroGPUI extension, not a HeroUI v3 API).
tree_view
TreeView and TreeItem — a hierarchical list with expandable rows (HeroGPUI extension; HeroUI v3 has no tree, only Table’s tree rows).
typography
Typography — port of @heroui/typography (HeroUI v3.2.4).
validation
The shared validate / validationErrors model.
virtual_list
VirtualList — a vertical list that renders only the rows in (and just around) the viewport, with programmatic scrolling to a row (HeroGPUI extension; HeroUI v3 has no such component). It has two modes, chosen by the VirtualListHandle it is built over:

Structs§

FieldFocus
[data-focus-visible] — whether a focus ring should be showing.
InteractiveState
v3’s interactive render props, as one value.
NumberFormat
formatOptions for the components that take it, re-exported so a caller reaches it beside the component it configures. The formatOptions subset these components use.
SelectionValue
v3’s value render props, as one value.

Enums§

Backdrop
Overlay scrim style — Modal, Drawer and AlertDialog.
Color
Semantic color roles — HeroUI v3.
CurrencySign
formatOptions for the components that take it, re-exported so a caller reaches it beside the component it configures. Intl.NumberFormatOptions["currencySign"].
FieldVariant
Form-control emphasis — primary carries the field shadow, secondary is the flat low-emphasis style for use inside a Surface.
NumberStyle
formatOptions for the components that take it, re-exported so a caller reaches it beside the component it configures. Intl.NumberFormatOptions["style"].
Orientation
Orientation for separators, toolbars, sliders and groups.
Placement
placement — where a floating panel sits relative to its trigger.
PlacementAlign
How a panel lines up along the trigger’s cross axis.
Prominence
Container prominence — Surface and Card. Separator uses the same ladder minus transparent.
SelectionBehavior
How a multi-select collection changes selection when an item is activated.
SelectionMode
How many items a collection lets the user select.
Size
The sm | md | lg scale used by most components.
SizeXl
The xs | sm | md | lg | xl scale used by Spinner, ColorSwatch and ColorSwatchPicker.
UnitDisplay
formatOptions for the components that take it, re-exported so a caller reaches it beside the component it configures. Intl.NumberFormatOptions["unitDisplay"].
Variant
Button emphasis variant — Button, and the vocabulary ButtonGroup inherits to its direct children (the pinned group context takes ButtonProps["variant"], every value on this enum).

Functions§

app_focus_root
Records keyboard-versus-pointer input, and moves the focus on Tab.