@impulse-ui-native/core
v3.0.0
Published
Core hooks and utilities for the ImpulseUI Native component library.
Maintainers
Readme
@impulse-ui-native/core
Framework-level hooks and small utilities shared across Impulse UI Native.
Installation
pnpm add @impulse-ui-native/coreMain exports
useControllableStatesupports controlled and uncontrolled component state.useEventCallbackreturns a stable callback that uses the latest handler.useIsOpenmanages common open/close state.useWhyDidYouUpdatehelps inspect prop changes during development.mergerecursively applies aDeepPartialvalue to a target object.uuidcreates unique identifiers.resolverStateSetterresolves React value-or-updater state arguments.DeepPartialis the recursive partial type used by theme overrides.
Example
import { useControllableState } from "@impulse-ui-native/core";
function Disclosure({ open, onOpenChange }) {
const [isOpen, setIsOpen] = useControllableState({
prop: open,
defaultProp: false,
onChange: onOpenChange,
});
// Render using isOpen and setIsOpen.
}This is a low-level package. Install @impulse-ui-native/toolkit when you want the complete UI system from one entry point.
