Repository navigation
hx components Hooks
github-actions[bot] edited this page Jul 1, 2026
·
1 revision
React hooks exported by @hx/components.
Manages IME composition state for input components. Prevents model updates during CJK IME composition.
import { useHxInputCompositionHandlers } from '@hx/components';
function CustomInput() {
const { onCompositionStart, onCompositionEnd, onCompositionUpdate } =
useHxInputCompositionHandlers();
return <input {...{ onCompositionStart, onCompositionEnd, onCompositionUpdate }} />;
}Manages value change and model commit logic with debounce support.
import { useHxInputValueChangeAndCommit } from '@hx/components';
const { handleChange, handleCommit } = useHxInputValueChangeAndCommit({
model,
field,
emitChangeOnBlur,
emitChangeDelay,
onChange,
});Accesses the select options context (provided by HxSelectOptionsProvider).
import { useSelectOptions } from '@hx/components';
function CustomOptionRenderer() {
const { options, selectedValue, searchText, selectOption } = useSelectOptions();
// ...
}Controls popup visibility from within popup content.
import { useHxPopupContext } from '@hx/components';
function PopupContent() {
const { show, hide, toggle, isVisible } = useHxPopupContext();
return <HxButton text="Close" onClick={hide} />;
}Accesses individual tab state.
import { useHxTab } from '@hx/components';
const { isActive, mark, activate } = useHxTab();Accesses the tabs container state.
import { useHxTabs } from '@hx/components';
const { tabs, activeMark, switchToTab } = useHxTabs();Accesses upload state and file operations.
import { useHxUpload } from '@hx/components';
const { files, uploading, addFiles, removeFile, uploadAll, clearFiles } = useHxUpload();Returns a file validation function based on accept rules (MIME types or extensions).
import { useAcceptCheck } from '@hx/components';
function MyUpload() {
const checkAccept = useAcceptCheck(['.pdf', '.docx', 'image/*']);
const handleFile = (file) => {
if (!checkAccept(file)) console.error('File type not accepted');
};
}- Overview
- Common Concepts
- I18n
- Data Attributes
- Form Components
- Layout Components
- Display Components
- Overlay Components
- Structure Components
- Validation
- Hooks
- Utilities