---
title: "TimePicker"
description: "A field for a time of day, with a list of times at a fixed step."
---

> Documentation Index
> Fetch the complete documentation index at: https://gistui.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# TimePicker

```gistui
root = Form("standup", TimePicker("time", "Daily standup", step:15, min:"08:00", max:"12:00", value:"09:30"))
```

## Signature

This is the line a model reads in the system prompt.

```gistui
TimePicker(name, label, step:num, min:str, max:str, value:str, placeholder:str, error:str, bind:$var, hint:str, size:Size, required)
```

- **Group:** Forms
- **Children:** No
- **Positional arguments:** `name`, `label` (a trailing `?` means it may be left out)

## Props

| Prop | Type | How to write it | Notes |
|---|---|---|---|
| `name` | string | positional, required |  |
| `label` | string | positional, required |  |
| `step` | number | named: `step:…` | minutes, default 30 |
| `min` | string | named: `min:…` | "09:00" |
| `max` | string | named: `max:…` |  |
| `value` | string | named: `value:…` |  |
| `placeholder` | string | named: `placeholder:…` |  |
| `error` | string | named: `error:…` |  |
| `bind` | `$state` variable | `bind:$name` | two-way binding to a $variable |
| `required` | flag | bare word: `required` |  |
| `hint` | string | named: `hint:…` |  |
| `size` | `sm` · `md` · `lg` | named: `size:…` | Also accepts `small`, `medium`, `large`. |

## Use your own component

Keep the name and schema, swap what is drawn. The prompt and the model's output do not change.

### React

```tsx
import { ui } from "@gistui/react/ui";

const lib = ui.extend({ TimePicker: MyTimePicker });
<GistUI library={lib} stream={response.body} />;
```
### Vue

```vue
<GistUI :source="answer" :components="{ TimePicker: MyTimePicker }" />
```
### Svelte

```svelte
<GistUI source={answer} components={{ TimePicker: MyTimePicker }} />
```
### Solid

```tsx
<GistUI source={answer()} components={{ TimePicker: MyTimePicker }} />
```
### Vanilla

```ts
import { ui } from "@gistui/vanilla/ui";

const lib = ui.extend({ TimePicker: (ctx) => ({ el: myElement(ctx) }) });
```

See [Custom components](/docs/guides/custom-components/) for the full contract. Style hook: `[data-gistui="TimePicker"]`.

Source: https://gistui.com/docs/components/forms/time-picker/index.mdx
