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 requiredReactNode—The inline picker rendered inside the dropdown.
dropdownHandlers requiredUseDisclosureHandlers—Open/close/toggle handlers for the dropdown (from `useDatesInput`/`useDisclosure`).
dropdownOpened requiredboolean—Whether the dropdown is open (owned by `useDatesInput`).
formattedValue requiredstring | null | undefined—Value displayed in the trigger (placeholder shows when empty).
onClear required() => void—Reset the value to empty (drives the clear button).
shouldClear requiredboolean—Whether 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 | undefined—Props passed to the clear button.
descriptionReactNode—Description rendered below the label.
disabled systemboolean | undefined—Disable the trigger.
dropdownTypePickerInputDropdownType | undefined'popover'Whether the picker opens in a floating `Popover` or a centered `Modal`.
errorReactNode—Error message / state.
formstring | undefined—Associated `<form>` id forwarded to the hidden input.
labelReactNode—Field label rendered above the trigger.
modalPropsPartial<Omit<ModalProps, "children">> | undefined—Props 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 | undefined—Form field name forwarded to the hidden input.
onDropdownClose(() => void) | undefined—Called 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 | undefined—Input placeholder shown when there is no value.
popoverPropsPartial<Omit<PopoverProps, "children">> | undefined—Props passed to the `Popover`.
readOnlyboolean | undefined—Prevent the value from being changed by the user (the dropdown stays closed).
requiredboolean | undefined—Mark 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> | undefined—Per-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 | undefined—Applies 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.

SlotTargets
dropdownProps for the Popover.Dropdown that holds the inline picker (ignored for dropdownType='modal').
inputProps for the trigger Input chrome (the InputBase frame + adornment props).
wrapperProps for the trigger's outer field column (Input.Wrapper frame).
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.

Edit this page on GitHub