Knit UI
GitHub

Playground

Loading playground…

Playground
<PickerInputBase
  type="default"
  value={null}
  formattedValue={null}
  onClear={() => {}}
  shouldClear={false}
  label="Event date"
  placeholder="Pick a date"
  clearable={false}
  disabled={false}
  readOnly={false}
  required={false}
  dropdownType="popover"
  size="sm"
/>

Examples

Default

Empty trigger with a label + placeholder; press it to open the dropdown.

Loading example…

DefaultSourceStorybook

With Value

A trigger displaying a formatted value.

Loading example…

With ValueSourceStorybook

Full Chrome

Description + required + error chrome (delegated to InputBase).

Loading example…

Full ChromeSourceStorybook

Clearable

Clearable — the clear button appears in the right section when a value is present.

Loading example…

ClearableSourceStorybook

Disabled

Disabled trigger — the dropdown cannot open.

Loading example…

DisabledSourceStorybook

Read Only

Read-only trigger — shows a value but cannot open the dropdown.

Loading example…

Read OnlySourceStorybook

Modal Dropdown

dropdownType="modal" — same trigger, picker presented in a centered Modal.

Loading example…

Modal DropdownSourceStorybook

Styles Slots

Per-slot styles sugar — tint the dropdown and pad the trigger via the slot map.

Loading example…

Styles SlotsSourceStorybook

Props

PropTypeDefaultDescription
children requiredReactNodeThe inline picker rendered inside the dropdown.
dropdownHandlers requiredUseDisclosureHandlersOpen/close/toggle handlers for the dropdown (from `useDatesInput`/`useDisclosure`).
dropdownOpened requiredbooleanWhether the dropdown is open (owned by `useDatesInput`).
formattedValue requiredstring | null | undefinedValue displayed in the trigger (placeholder shows when empty).
onClear required() => voidReset the value to empty (drives the clear button).
shouldClear requiredbooleanWhether the clear button should be shown (a value is present and `clearable`).
type required"multiple" | "default" | "range"Picker selection mode.
value requiredDateValue | DatesRangeValue | DateValue[]Value forwarded to the hidden form field.
clearableboolean | undefinedfalseShow a clear button in the right section when the field has a value.
clearButtonPropsCloseButtonProps | undefinedProps passed to the clear button.
descriptionReactNodeDescription rendered below the label.
disabled systemboolean | undefinedDisable the trigger.
dropdownTypePickerInputDropdownType | undefined'popover'Whether the picker opens in a floating `Popover` or a centered `Modal`.
errorReactNodeError message / state.
formstring | undefinedAssociated `<form>` id forwarded to the hidden input.
labelReactNodeField label rendered above the trigger.
modalPropsPartial<Omit<ModalProps, "children">> | undefinedProps passed to the `Modal` when `dropdownType="modal"` (ignored for the `popover` dropdown). Spread before the component's own `opened`/`onClose`/ `title`, so those always win; the `withCloseButton={false}` default is overridable via `modalProps.withCloseButton`.
namestring | undefinedForm field name forwarded to the hidden input.
onDropdownClose(() => void) | undefinedCalled when the dropdown closes, after the incomplete-range reset. Lets a wrapper run extra close-time logic (e.g. `DateTimePicker`'s min/max clamp).
placeholderstring | undefinedInput placeholder shown when there is no value.
popoverPropsPartial<Omit<PopoverProps, "children">> | undefinedProps passed to the `Popover`.
readOnlyboolean | undefinedPrevent the value from being changed by the user (the dropdown stays closed).
requiredboolean | undefinedMark the field as required (adds the asterisk to the label).
shadow system"xs" | "sm" | "md" | "lg" | "xl" | "xxs" | "xxl" | undefined
size systemInputSize | undefined'sm'Trigger size (Input scale).
styles systemSlotStyles<PickerInputBaseStyles> | undefinedPer-slot style sugar — props spread onto the matching composed part (`wrapper`/`input`/`dropdown`). Sits UNDER the explicit per-part props (`popoverProps`/`clearButtonProps`/inline trigger props), which always win.
theme systemThemeName | null | undefinedApplies a theme to this element
variant systemInputVariant | undefined'default'Visual variant of the input chrome (`default`/`filled`/`unstyled`).
withTimeboolean | undefinedfalseSerialize the hidden field value with time.

Style slots

Every part of PickerInputBase can be styled through the styles prop. Explicit props on the component always win over slot styles.

SlotUsage
dropdownstyles={{ dropdown: { … } }}
inputstyles={{ input: { … } }}
wrapperstyles={{ wrapper: { … } }}
Accessibility & DOM props (2)
PropType
keyKey | null | undefined
refRef<TamaguiElement> | undefined

Plus 496 inherited style props from Box — the full Tamagui/React Native style surface, including token shorthands like p, mx, bg and c. See Tokens for the scales they accept, or the full list.