UNPKG

@workday/canvas-kit-react

Version:

The parent module that contains all Workday Canvas Kit React components

22 lines (21 loc) 559 B
import { createModelHook, useUniqueId } from '@workday/canvas-kit-react/common'; export const usePillModel = createModelHook({ defaultConfig: { /** * Used to disable a pill and apply the correct styles. */ disabled: false, /** * ID used to add accessibility labels to pill elements. * @default `useUniqueId()` */ id: '', }, })(config => { const id = useUniqueId(config.id); const state = { ...config, id, }; return { state, events: {} }; });