Renders a form's choice among a few values as a row of buttons, and the public/private toggle that the dump and playlist forms build on it.
f
SegmentedField<T extends FieldValues, V>(unnamed 0: SegmentedFieldProps<T, V>): React.JSX.Element
Renders a Segmented bound to the field name, under its label. It
must sit under a react-hook-form FormProvider.
f
VisibilityToggle<T extends FieldValues>(unnamed 0: VisibilityToggleProps<T>): React.JSX.Element
Renders a Public/Private toggle on a boolean field that is true for public.
A dump's API takes isPrivate instead, so the dump forms bind the toggle to
an isPublic field and invert it on submit.
I
SegmentedFieldProps
Passed to SegmentedField by a form, or by VisibilityToggle.
I
VisibilityToggleProps
Passed to VisibilityToggle by a dump or playlist form.
- disabled: boolean
- label: string
-
name: Path<T>
A boolean field, true for public.
Usage
import * as mod from "src/components/form/SegmentedField.tsx";