You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,7 +110,7 @@ Main component. Renders the full picker.
110
110
|`calendar`|`boolean`| No |`true`| Show the popover calendar on the left of the header. |
111
111
|`CalendarProps`|`DayPickerProps` from `react-day-picker`| No |`undefined`| Pass through props to the inner calendar (months, locale, modifiers, etc.). |
112
112
|`Slots`|`Slots`| No |`{}`| Replace any visible part with your own component. |
113
-
|`api`|`RangeFlowApi`| No |`undefined`| Hook returned object for external control. See `useRangeflow`. |
113
+
|`api`|`RangeFlowApi`| No |`undefined`| Hook returned object for external control. See `useRangeFlow`. |
114
114
115
115
#### Types
116
116
@@ -126,12 +126,12 @@ type DateDisabled =
126
126
| { before?:Date; after:Date }
127
127
```
128
128
129
-
### `useRangeflow()`
129
+
### `useRangeFlow()`
130
130
131
131
Returns an imperative API object. Pass it into `<RangeFlowapi={...} />` to control the picker from outside.
132
132
133
133
```ts
134
-
const rangeflow =useRangeflow()
134
+
const rangeflow =useRangeFlow()
135
135
136
136
rangeflow.updateRange({ from, to }) // change the window
137
137
rangeflow.updateSelectedDates({ from, to }) // change the picked range
@@ -339,16 +339,16 @@ Keep the slider and tabs, drop the popover calendar.
339
339
/>
340
340
```
341
341
342
-
### 8. External controls with `useRangeflow`
342
+
### 8. External controls with `useRangeFlow`
343
343
344
344
Drive the picker from buttons, forms, or URL params.
@@ -503,12 +503,12 @@ Use these class names to style parts of the picker without touching the tokens.
503
503
504
504
If you are an AI tool generating code with RangeFlow, keep these facts in mind:
505
505
506
-
- The package is `rangeflow`. Only two named exports are public: `RangeFlow` (component) and `useRangeflow` (hook). Also a type export `RangeFlowApi`.
506
+
- The package is `rangeflow`. Only two named exports are public: `RangeFlow` (component) and `useRangeFlow` (hook). Also a type export `RangeFlowApi`.
507
507
- Always import the CSS file once: `import 'rangeflow/style.css'`.
508
508
-`defaultRange` and `defaultSelected` are required. Both must be `{ from: Date; to: Date }`.
509
509
-`defaultSelected` must fit inside `defaultRange` or the slider will clamp it.
510
510
-`onChange` is required and fires with `{ from: Date; to: Date }`.
511
-
- To drive the picker from outside, call `useRangeflow()` and pass the result to `<RangeFlow api={...} />`. Then use `updateRange` or `updateSelectedDates`.
511
+
- To drive the picker from outside, call `useRangeFlow()` and pass the result to `<RangeFlow api={...} />`. Then use `updateRange` or `updateSelectedDates`.
512
512
- Theming is CSS variable based. Set `--rangeflow-accent` on any parent to re-skin the picker.
513
513
- Dark mode turns on via a `dark` class or `data-theme="dark"` on the picker or any parent.
514
514
- The picker is 560px wide and 140px tall by default (`w-140 h-35` in Tailwind units).
0 commit comments