# Hooks

Crate: `libero`
Index: [index.md](index.md) lists every other page
Description: Every public libero hook in one table, with what it is for and the page that shows it.

Libero's components are built from these hooks, and they are public for yours.
They are positional like every dioxus hook, so call them unconditionally, in the
same order every render.

## Every public hook

The primitives and the theme-set and stylesheet hooks have a page of their own;
the unique ID, focus return and accessibility settings hooks have theirs under
Accessibility. The rest are shown on the component or guide page they belong to.

| Hook | What it is for | Page |
|---|---|---|
| `use_id` | A unique id for the aria wiring between one instance's elements. | [Unique ID](use_id.md) |
| `use_element` | A handle to one of your component's elements, to focus, scroll or measure it. | [Element handle](use_element.md) |
| `use_focus_return` | Puts focus back on the trigger when a panel closes. | [Focus return](use_focus_return.md) |
| `use_drag` | Pointer capture and deltas for a drag. | [Drag](use_drag.md) |
| `use_sortable` | A list whose items reorder by dragging their handle. | [Sortable list](use_sortable.md) |
| `use_sortable_item` | One item of a use_sortable list: its handle and offset. | [Sortable list](use_sortable.md) |
| `use_labelled_sortable_item` | use_sortable_item with a name for the announcements. | [Sortable list](use_sortable.md) |
| `use_intersection` | How much of an element is visible inside a root. | [Intersection](use_intersection.md) |
| `use_in_viewport` | Whether an element is in the viewport. | [Intersection](use_intersection.md) |
| `use_long_press` | Handlers that call back once a pointer stays down. | [Long press](use_long_press.md) |
| `use_swipe` | Handlers that call back once a touch swipes far enough one way. | [Swipe](use_swipe.md) |
| `use_edge_swipe` | Opens a drawer by a swipe in from the screen's start edge. | [Swipe](use_swipe.md) |
| `use_timeout` | Runs a callback once, a while after you start it. | [Timers](use_timers.md) |
| `use_interval` | Runs a callback repeatedly, with start, stop and toggle. | [Timers](use_timers.md) |
| `use_countdown` | The time left until an end, live, on one ticker every countdown shares. | [Countdown](use_countdown.md) |
| `use_debounced_value` | A signal that follows another once it stops changing. | [Debounce and throttle](use_debounce.md) |
| `use_debounced_callback` | A callback that runs after its last call, with the last argument. | [Debounce and throttle](use_debounce.md) |
| `use_throttled_value` | A signal that follows another at most once per period. | [Debounce and throttle](use_debounce.md) |
| `use_throttled_callback` | A callback that runs at once, then at most once per period. | [Debounce and throttle](use_debounce.md) |
| `use_history` | Undo and redo over snapshots of a value, rapid changes grouped. | [History](use_history.md) |
| `use_hotkeys` | Runs a handler on a keyboard shortcut, from anywhere in the page. | [Hotkeys](use_hotkeys.md) |
| `use_media_query` | Whether a CSS media query matches, live. | [Media query](use_media_query.md) |
| `use_is_mobile` | Whether the viewport is narrower than 768px, live. | [Media query](use_media_query.md) |
| `use_responsive` | A per-breakpoint value read in Rust; a server-rendered page switches after mount. | [Styling](styling.md) |
| `use_media` | Plays and reads an `<audio>` or `<video>` you render yourself. | [Media](use_media.md) |
| `use_fullscreen` | Puts one element in fullscreen, drawn where the platform refuses it. | [Fullscreen](use_fullscreen.md) |
| `use_back` | Runs a handler on Android's Back button instead of leaving the app. | [Back button](use_back.md) |
| `use_geolocation` | The device's position, once or followed, and the location permission. | [Geolocation](use_geolocation.md) |
| `use_tour` | A guided tour that spotlights one element per step. | [Tour](tour.md) |
| `use_local_storage` | A value kept under a key across reloads and app runs. | [Local storage](use_local_storage.md) |
| `use_session_storage` | A value kept under a key for the tab or the window's run. | [Local storage](use_local_storage.md) |
| `use_local_storage_with` | use_local_storage with options, such as reading the value after mount. | [Local storage](use_local_storage.md) |
| `use_session_storage_with` | use_session_storage with options, such as reading the value after mount. | [Local storage](use_local_storage.md) |
| `use_indexed_db` | A larger value kept under a key, loaded and saved without blocking the page. | [IndexedDB](use_indexed_db.md) |
| `use_user_media` | The camera and microphone: a preview, a photo and a recording. | [User media](use_user_media.md) |
| `use_user_media_devices` | The page's cameras and microphones, live. | [User media](use_user_media.md) |
| `use_system_notification` | Notifications the operating system draws, and their permission. | [System notifications](use_system_notification.md) |
| `use_push_subscription` | A web push subscription for the app's server to push to. | [System notifications](use_system_notification.md) |
| `use_fcm` | Android's Firebase Cloud Messaging token and messages, behind the fcm feature. | [Firebase messaging](use_fcm.md) |
| `use_theme` | The active theme, for values CSS cannot carry. | [Theming](theming.md) |
| `use_theme_set` | Reads and swaps the active theme set. | [Theme set](use_theme_set.md) |
| `use_color_scheme` | Reads and sets the light or dark colour scheme. | [ThemeSwitcher](theme_switcher.md) |
| `use_direction` | Reads and sets the text direction, left to right or right to left. | [DirectionToggle](direction_toggle.md) |
| `use_localization` | The words libero's components say, in the active language. | [Localization](localization.md) |
| `use_localization_handle` | Switches the language at runtime. | [Localization](localization.md) |
| `use_formats` | The active date, time and number formats. | [Localization](localization.md) |
| `use_formats_handle` | Switches the formats at runtime. | [Localization](localization.md) |
| `use_stylesheet` | Registers a stylesheet of your own, above every libero layer. | [Stylesheet](use_stylesheet.md) |
| `use_accessibility` | The reader's motion, contrast and transparency settings; forces reduced motion. | [Accessibility settings](use_accessibility.md) |
| `use_clipboard` | Copies text and tells whether the last copy landed. | [Copy](copy.md) |
| `use_share` | Opens the system share sheet, or copies the link where there is none. | [Share](share.md) |
| `use_icon` | The glyph an IconProvider sets for a slot, else your default. | [IconProvider](icon_provider.md) |
| `use_scroll_area` | Scrolls a ScrollArea from code. | [ScrollArea](scroll_area.md) |
| `use_scroller` | Steps a Scroller from controls of your own. | [Scroller](scroller.md) |
| `use_chart` | Reads a chart's drawing as SVG or PNG, saves it, resets its zoom. | [Chart](chart.md) |
| `use_form` | Controls a Form: validity, check, submit and reset. | [Form](form.md) |
| `use_form_context` | The handle of the Form it is called inside. | [Form](form.md) |
| `use_combobox` | Keeps a Combobox's open state in your scope. | [Combobox](combobox.md) |
| `use_cascader` | Keeps a CascaderDropdown's value and open state for a trigger of your own. | [Cascader](cascader.md) |
| `use_rich_text_editor` | Drives a RichTextEditor from toolbar controls of your own. | [RichTextEditor](rich_text_editor.md) |
| `use_modal` | Registers a modal and returns the handle that opens it. | [Modal](modal.md) |
| `use_modal_close` | Closes the modal it is rendered in. | [Modal](modal.md) |
| `use_drawer` | Registers a drawer and returns the handle that opens it. | [Drawer](drawer.md) |
| `use_popover` | Places a floating box next to an anchor. | [Popover](popover.md) |
| `use_menu` | Keeps a Menu's open state in your scope. | [Menu](menu.md) |
| `use_spotlight` | Registers a command palette and its hotkey. | [Spotlight](spotlight.md) |
| `use_lightbox` | Opens a picture viewer over the page. | [Lightbox](lightbox.md) |
| `use_floating_window` | Opens a movable, non-modal window. | [FloatingWindow](floating_window.md) |
| `use_notifications` | Shows notifications drawn as an Alert. | [Notifications](notifications.md) |
| `use_notifications_with` | Notifications of your own data type and template. | [Notifications](notifications.md) |
