Knit UI
DocsComponentsFoundationsGuidesChangelog
GitHub
  • What is Knit UI
  • Why Knit UI
  • Architecture
  • Packages
  • Installation
  • Quickstart
  • Expo
  • Next.js
  • Vite
  • Bundler setup
  • Server rendering
  • TypeScript
  • Troubleshooting
  • Principles
  • Tokens
  • Color & themes
  • Theme builder
  • Typography
  • Sizing
  • Variants & colors
  • Elevation
  • Motion
  • Focus & a11y
  • Layout
  • Slots & styles
  • Gradients
  • Responsive
  • Dark mode
  • Icons
  • styled()
  • useAppState
  • useCallbackRef
  • useClipboard
  • useCounter
  • useDebouncedCallback
  • useDebouncedValue
  • useDidUpdate
  • useDisclosure
  • useDismissOnScroll
  • useElementSize
  • useFocusTrap
  • useForceUpdate
  • useId
  • useInterval
  • useIsFirstRender
  • useKeyboardActions
  • useKeyboardHeight
  • useListState
  • useMergedRef
  • useMounted
  • useMove
  • useOs
  • usePagination
  • usePrevious
  • useQueue
  • useRadialMove
  • useReducedMotion
  • useSetState
  • useThrottledCallback
  • useThrottledValue
  • useTimeout
  • useUncontrolled
  • useValidatedState
  • useViewportSize

@knitui/hooks

useId

Stable id, using a provided id when present (port of Mantine's useId).

WebiOSAndroid
Source

Import

import { useId } from "@knitui/hooks";

Signature

export function useId(staticId?: string): string
PrevioususeForceUpdateNextuseInterval
MIT licensed · © The HausGitHub · npm · Storybook