0.0.9 • Published 8 months ago

scoops-headless v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Scoops-headless

Scoops-headless is a headless ui component like HeadlessUI

Components

Modal

PropsDescriptionType
isOpenIs modal openboolean
setIsOpenset modal open state(open: boolean) => void
disabledOutsideDismissdisabled closing modal while clicking outsideboolean
childrenChildren ElementReactNode
overlayClassNameoverlay's class namestring
transitionstransition configTransitionConfig
*TransitionConfigtransition settingenter?: string; enterFrom?: string; enterTo?: string; leave?: string; leaveFrom?: string; leaveTo?: string;
overlayshow overlay (backdrop)boolean
wrapperClassNamemodal wrapper classNamestring
portalClassNamemodal wrapper classNamestring

Drawer

PropsDescriptionType
isOpenIs modal openboolean
setIsOpenset modal open state(open: boolean) => void
disabledOutsideDismissdisabled closing modal while clicking outsideboolean
childrenChildren ElementReactNode
overlayClassNameoverlay's class namestring
transitionstransition configTransitionConfig
*TransitionConfigtransition settingenter?: string; enterFrom?: string; enterTo?: string; leave?: string; leaveFrom?: string; leaveTo?: string;
overlayshow overlay (backdrop)boolean
sidewhich side the drawer appears"top" , "bottom" , "left" , "right"
portalClassNamemodal wrapper classNamestring

Popover

Popover.Wrapper

A component wraps the reference and panel components, handling the logic for showing/hiding the popover and managing its position.

PropsDescriptionType
children (function)A function receiving { isOpen, setIsOpen } to control popover state.({isOpen, setIsOpen}) => ReactNode
overlayShow overlay (backdrop).boolean
overlayClassNameClass name for overlay styling.string
portalRender popover using a portal. Default is true.boolean (optional)
disabledOutsideDismissDisable dismissing on outside click. Default is false.boolean (optional)
strategyPopover positioning strategy: "absolute" or "fixed"."absolute" | "fixed"
placementPlacement of the popover relative to the reference.Placement
offsetOffset options for popover positioning.number | null, number | null
fallbackPlacementsFallback placements if primary placement is unavailable.Array<Placement>
portalClassNamemodal wrapper classNamestring
disableUpdateOnOpendisable update ui function when popover is openingboolean

Popover.Panel

The Panel component contains the content displayed within the popover. | Props | Description | Type | | --- | --- | --- | | children | Content within the panel. | ReactNode | | className | Additional CSS class for styling. | string (optional) |

Popover.Reference

The Reference component functions as the popover's trigger element. When clicked, it toggles the popover's visibility.

PropsDescriptionType
childrenContent within the reference element.ReactNode
classNameAdditional CSS class for styling.string (optional)

SelectBox

SelectBox.Wrapper

A component serves as the main container for the select box. It manages the state and configuration for the select box and its related components.

PropsDescriptionType
childrenA function receiving parameters to control the select box.({ selected, active, openMenu, closeMenu, isOpen }) => ReactNode
optionsAn array of options for the select box.Generic\<T>[]
isOpenOptional boolean to control the initial open state.boolean
setIsOpenOptional function to set the open state.(val: boolean) => void
onChangeFunction called when the selected item changes.(v: Generic\<T> | null) => void
initialSelectedItemInitial selected itemGeneric\<T> | null

SelectBox.Options

The SelectBox.Options component displays the available options within the select box

PropsDescriptionType
childrenA function receiving options to render.(options: Generic\<T>[]) => ReactNode
classNameOptional CSS class name for styling.string

SelectBox.Option

The SelectBox.Option component represents an individual option within the select box.

PropsDescriptionType
childrenContent within the option element.ReactNode
itemThe item associated with the option.Generic\<T>
indexThe index of the option within the list.number
keyReact's key prop (automatically generated).string

SelectBox.Reference

The SelectBox.Reference component serves as the trigger element for the select box. Clicking it opens or closes the dropdown.

PropsDescriptionType
childrenContent within the reference element.ReactNode

SelectBox.Label

The SelectBox.Label component displays a label for the select box. | Props | Description | Type | | --- | --- | --- | | children | Content within the reference element. | ReactNode |

ComboBox

ComboBox.Wrapper

The ComboBox.Wrapper component serves as the main container for the combo box. It manages the state and configuration for the combo box and its related components

PropsDescriptionType
childrenA function receiving parameters to control the combo box.({ selected, active, openMenu, closeMenu, isOpen }) => ReactNode
optionsAn array of options for the combo box.Generic\<T>[]
isOpenOptional boolean to control the initial open state.boolean
setIsOpenOptional function to set the open state.(val: boolean) => void
onChangeFunction called when the selected item changes.(v: Generic\<T> | null) => void
onInputValueChangeFunction called when the input value changes.(val: string) => void
itemToStringFunction to convert an item to a string representation.(val: Generic\<T> | null) => string
initialSelectedItemInitial selected itemGeneric\<T> | null

ComboBox.Options

The ComboBox.Options component displays the available options within the combo box.

PropsDescriptionType
childrenA function receiving options to render.(options: Generic\<T>[]) => ReactNode
classNameOptional CSS class name for styling.string

ComboBox.Option

The ComboBox.Option component represents an individual option within the combo box.

PropsDescriptionType
childrenContent within the option element.ReactNode
itemThe item associated with the option.Generic\<T>
indexThe index of the option within the list.number
keyReact's key prop (automatically generated).string

ComboBox.Input

The ComboBox.Input component provides an input element for the combo box. | Props | Description | Type | | --- | --- | --- | | className | Optional CSS class name for styling. | string | | ...rest | Additional input attributes (e.g., placeholder). | HTMLInputElement Attributes |

ComboBox.Label

The ComboBox.Label component displays a label for the combo box.

PropsDescriptionType
childrenContent within the label element.ReactNode

MultipleSelect

MultipleSelect.Wrapper

The MultipleSelect.Wrapper component serves as the main container for the multiple-select component. It manages the state and configuration for the multiple-select and its related components.

PropsDescriptionType
childrenA function receiving parameters to control the multiple-select.({ selected, active, openMenu, closeMenu, isOpen }) => ReactNode
optionsAn array of options for the multiple-select.Generic\<T>[]
isOpenOptional boolean to control the initial open state.boolean
setIsOpenOptional function to set the open state.(val: boolean) => void
onSelectedItemFunction called when the selected item changes.(v: Generic\<T> | null) => void
onItemsChangeFunction called when the selected items change.(v: Generic\<T>[] | null) => void
selectedItemsArray of initially selected items.Generic\<T>[]
onInputValueChangeFunction called when the input value changes.(val: string) => void
itemToStringFunction to convert an item to a string representation.(val: Generic\<T> | null) => string

MultipleSelect.Options

The MultipleSelect.Options component displays the available options within the multiple-select.

PropsDescriptionType
childrenA function receiving options to render.(options: Generic\<T> []) => ReactNode
classNameOptional CSS class name for styling.string

MultipleSelect.Option

The MultipleSelect.Option component represents an individual option within the multiple-select.

PropsDescriptionType
childrenContent within the option element.ReactNode
itemThe item associated with the option.Generic\<T>
indexThe index of the option within the list.number
keyReact's key prop (automatically generated).string

MultipleSelect.Input

The MultipleSelect.Input component provides an input element for the multiple-select.

PropsDescriptionType
classNameOptional CSS class name for styling.string
restAdditional input attributes (e.g., placeholder).HTMLInputElement Attributes

MultipleSelect.Label

The MultipleSelect.Label component displays a label for the multiple-select.

PropsDescriptionType
childrenContent within the label element.ReactNode

Transition

PropDescriptionType
enterClass to be applied when entering.string
enterFromClass to be applied when starting entering.string
enterToClass to be applied when finishing entering.string
leaveClass to be applied when leaving.string
leaveFromClass to be applied when starting leaving.string
leaveToClass to be applied when finishing leaving.string
showDetermines if the element is shown or not.boolean
childrenContent to be transitioned.ReactNode
classNameAdditional CSS class name for styling.string
0.0.9

8 months ago

0.0.8

8 months ago

0.0.7

8 months ago

0.0.6

8 months ago

0.0.5

8 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago