API Reference / @gtkx/components
@gtkx/components
Type Aliases
| Type Alias | Description |
|---|---|
| ColumnViewColumn | One column of a ColumnView, pairing Gtk.ColumnViewColumn props with a cell renderer. |
| ColumnViewProps | Native Gtk.ColumnView props with declarative columns and collections, controlled selection, expansion, and sorting. |
| ComboRowProps | Native Adw.ComboRow props with declarative collections, controlled selection, and display/popup renderers. |
| DropDownProps | Native Gtk.DropDown props with declarative collections, controlled selection, and display/popup renderers. |
| ExpanderDescriptions | Wording a screen reader announces for the control that expands and collapses a row. GTK names that control after the row's own content and reports whether it is expanded, but says nothing about what activating it does, so these strings supply that and belong in the application's own language. |
| GridViewProps | Native Gtk.GridView props with declarative cells, controlled selection, and estimated sizing. |
| ListItem | A single item in a collection model, identified by a stable id and holding an arbitrary value. Nested items form a tree. I narrows the id to the application's own union of ids, which the selection and expansion props of the view rendering the items then share. |
| ListItemFactoryProps | - |
| ListItemRenderArgs | Arguments passed to a ListItemRenderer when rendering one cell. |
| ListItemRenderer | Renders the contents of one cell of a collection view. |
| ListRowProps | Properties applied to the row that carries one item: the Gtk.ListItem of a list or grid, or the Gtk.ColumnViewRow of a table. Neither is a widget, so these are the only handles they offer; anything omitted falls back to the row's own default, which leaves the accessibility strings unset rather than setting them to an empty string. |
| ListRowPropsResolver | Returns the ListRowProps to apply to the row displaying one item, re-run whenever the item renders. |
| ListSection | A group of items rendered under a shared section header. |
| ListSectionRenderArgs | Arguments passed to a ListSectionRenderer when rendering one section header. |
| ListSectionRenderer | Renders the contents of one section header of a collection view. |
| ListViewProps | Native Gtk.ListView props with declarative rows and sections, controlled selection and expansion, and estimated sizing. |
| StatefulActionProps | Props of a StatefulAction whose state is a boolean or a string, with the GVariant type inferred from the value. T narrows a string state to the application's own union of choices. |
| ToastController | Imperative controls for toasts, returned by useToast. |
| ToastOptions | Describes a toast raised through useToast: the construct-time properties of an Adw.Toast plus its button-clicked and dismissed handlers. |
| ToastProviderProps | Props for ToastProvider. |
| TypedStatefulActionProps | Props of a StatefulAction whose state has the GVariant type stateType. |
Variables
| Variable | Description |
|---|---|
| ColumnView | Renders a Gtk.ColumnView from declarative items or sections and a columns array, with controlled selection, expansion, and sorting, per-column header menus, section header rendering, and per-row props such as a screen-reader label. |
| ComboRow | Renders an Adw.ComboRow backed by a collection model, presenting the same choice as a DropDown in the shape of a preferences row, with customizable renderers for the row display, popup rows, and popup section headers, and controlled selection. |
| DropDown | Renders a Gtk.DropDown backed by a collection model, with customizable renderers for the collapsed display, popup rows, and popup section headers, and controlled selection. |
| GridView | Renders a Gtk.GridView of uniform cells from declarative items, with per-cell rendering, controlled selection, and estimated item sizing. |
| ListView | Renders a Gtk.ListView from declarative items or sections, with per-row rendering, controlled selection, controlled tree expansion, and estimated item sizing. |
| StatefulAction | Renders a Gio.SimpleAction whose state is a plain JavaScript value instead of a GLib.Variant. The state is controlled: a menu item, a button or an activation only requests a new state through onStateChange, and the action changes when state does. A boolean state makes a toggle. Any other state makes a choice that an item selects by passing the value as its target. |
Functions
| Function | Description |
|---|---|
| ListItemFactory | Creates a Gtk.SignalListItemFactory that renders objects from an existing native model with React. Estimated dimensions keep cells stable until their content mounts. |
| ToastOverlay | Renders an Adw.ToastOverlay and registers it with the nearest ToastProvider, whose useToast callers then show their toasts over its content. |
| ToastProvider | Gives useToast in every descendant the ToastOverlay rendered below it. With several overlays, toasts go to the one mounted last. |
| useToast | Returns a ToastController that shows and dismisses toasts on the nearest provider's overlay. |