@react-types/shared

Search for an npm package

@react-types/shared

module "@react-types/shared" {
export interface AriaLabelingProps {

Defines a string value that labels the current element.

'aria-label'?: string;

Identifies the element (or elements) that labels the current element.

'aria-labelledby'?: string;

Identifies the element (or elements) that describes the object.

'aria-describedby'?: string;

Identifies the element (or elements) that provide a detailed, extended description for the object.

'aria-details'?: string;
}
Referenced by
  • FormProps
export interface AriaValidationProps {

Identifies the element that provides an error message for the object.

'aria-errormessage'?: string;
}
export interface DOMProps {

The element's unique identifier. See MDN.

id?: string;
}
Referenced by
export interface FocusableDOMProps extends DOMProps {

Whether to exclude the element from the sequential tab order. If true, the element will not be focusable via the keyboard by tabbing. This should be avoided except in rare scenarios where an alternative means of accessing the element or its functionality via the keyboard is available.

excludeFromTabOrder?: boolean;
}
export interface TextInputDOMEvents<T = HTMLInputElement> {

Handler that is called when the user copies text. See MDN.

onCopy?: ClipboardEventHandler<T>;

Handler that is called when the user cuts text. See MDN.

onCut?: ClipboardEventHandler<T>;

Handler that is called when the user pastes text. See MDN.

onPaste?: ClipboardEventHandler<T>;

Handler that is called when a text composition system starts a new text composition session. See MDN.

onCompositionStart?: CompositionEventHandler<T>;

Handler that is called when a text composition system completes or cancels the current text composition session. See MDN.

onCompositionEnd?: CompositionEventHandler<T>;

Handler that is called when a new character is received in the current text composition session. See MDN.

onCompositionUpdate?: CompositionEventHandler<T>;

Handler that is called when text in the input is selected. See MDN.

onSelect?: ReactEventHandler<T>;

Handler that is called when the input value is about to be modified. See MDN.

onBeforeInput?: FormEventHandler<T>;

Handler that is called when the input value is modified. See MDN.

onInput?: FormEventHandler<T>;
}
Referenced by
export interface InputDOMProps {

The name of the input element, used when submitting an HTML form. See MDN.

name?: string;

The <form> element to associate the input with. The value of this attribute must be the id of a <form> in the same document. See MDN.

form?: string;
}
Referenced by
export interface TextInputDOMProps<T = HTMLInputElement> extends DOMProps, InputDOMProps, TextInputDOMEvents<T> {

Describes the type of autocomplete functionality the input should provide if any. See MDN.

autoComplete?: string;

The maximum number of characters supported by the input. See MDN.

maxLength?: number;

The minimum number of characters required by the input. See MDN.

minLength?: number;

Regex pattern that the value of the input must match to be valid. See MDN.

pattern?: string;

Content that appears in the input when it is empty. See MDN.

placeholder?: string;

The type of input to render. See MDN.

more
less

@default — 'text'

type?: "text" | "search" | "url" | "tel" | "email" | "password" | (string & {});

Hints at the type of data that might be entered by the user while editing the element or its contents. See MDN.

inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search";

An attribute that takes as its value a space-separated string that describes what, if any, type of autocomplete functionality the input should provide. See MDN.

autoCorrect?: string;

An enumerated attribute that defines whether the element may be checked for spelling errors. See MDN.

spellCheck?: string;
}

This type allows configuring link props with router options and type-safe URLs via TS module augmentation. By default, this is an empty type. Extend with href and routerOptions properties to configure your router.

export interface RouterConfig {}
Referenced by
export type Href = RouterConfig extends {
href: infer H;
} ? H : string
Referenced by
export type RouterOptions = RouterConfig extends {
routerOptions: infer O;
} ? O : never
Referenced by
export interface LinkDOMProps {

A URL to link to. See MDN.

href?: Href;

Hints at the human language of the linked URL. SeeMDN.

hrefLang?: string;

The target window for the link. See MDN.

target?: HTMLAttributeAnchorTarget;

The relationship between the linked resource and the current page. See MDN.

rel?: string;

Causes the browser to download the linked URL. A string may be provided to suggest a file name. See MDN.

download?: boolean | string;

A space-separated list of URLs to ping when the link is followed. See MDN.

ping?: string;

How much of the referrer to send when following the link. See MDN.

referrerPolicy?: HTMLAttributeReferrerPolicy;

Options for the configured client side router.

routerOptions?: RouterOptions;
}
Referenced by

Any focusable element, including both HTML and SVG elements.

export interface FocusableElement extends Element, HTMLOrSVGElement {}
Referenced by

All DOM attributes supported across both HTML and SVG elements.

export interface DOMAttributes<T = FocusableElement> extends AriaAttributes, ReactDOMAttributes<T> {
id?: string | undefined;
role?: AriaRole | undefined;
tabIndex?: number | undefined;
style?: CSSProperties | undefined;
className?: string | undefined;
}
Referenced by
export interface DOMAttributesWithRef<T = Element> extends DOMAttributes<T>, RefAttributes<T> {}
export interface GroupDOMAttributes extends Omit<DOMAttributes<HTMLElement>, "role"> {
role?: "group" | "region" | "presentation";
}

Global attributes that can be applied to any DOM element.

more
less

@private —

export interface GlobalDOMAttributes<T = Element> extends GlobalDOMEvents<T> {
dir?: string | undefined;
lang?: string | undefined;
hidden?: boolean | undefined;
inert?: boolean | undefined;
translate?: "yes" | "no" | undefined;
}

Global DOM events that are supported on all DOM elements.

more
less

@private —

export interface GlobalDOMEvents<T = Element> {
onClick?: MouseEventHandler<T> | undefined;
onClickCapture?: MouseEventHandler<T> | undefined;
onAuxClick?: MouseEventHandler<T> | undefined;
onAuxClickCapture?: MouseEventHandler<T> | undefined;
onContextMenu?: MouseEventHandler<T> | undefined;
onContextMenuCapture?: MouseEventHandler<T> | undefined;
onDoubleClick?: MouseEventHandler<T> | undefined;
onDoubleClickCapture?: MouseEventHandler<T> | undefined;
onMouseDown?: MouseEventHandler<T> | undefined;
onMouseDownCapture?: MouseEventHandler<T> | undefined;
onMouseEnter?: MouseEventHandler<T> | undefined;
onMouseLeave?: MouseEventHandler<T> | undefined;
onMouseMove?: MouseEventHandler<T> | undefined;
onMouseMoveCapture?: MouseEventHandler<T> | undefined;
onMouseOut?: MouseEventHandler<T> | undefined;
onMouseOutCapture?: MouseEventHandler<T> | undefined;
onMouseOver?: MouseEventHandler<T> | undefined;
onMouseOverCapture?: MouseEventHandler<T> | undefined;
onMouseUp?: MouseEventHandler<T> | undefined;
onMouseUpCapture?: MouseEventHandler<T> | undefined;
onTouchCancel?: TouchEventHandler<T> | undefined;
onTouchCancelCapture?: TouchEventHandler<T> | undefined;
onTouchEnd?: TouchEventHandler<T> | undefined;
onTouchEndCapture?: TouchEventHandler<T> | undefined;
onTouchMove?: TouchEventHandler<T> | undefined;
onTouchMoveCapture?: TouchEventHandler<T> | undefined;
onTouchStart?: TouchEventHandler<T> | undefined;
onTouchStartCapture?: TouchEventHandler<T> | undefined;
onPointerDown?: PointerEventHandler<T> | undefined;
onPointerDownCapture?: PointerEventHandler<T> | undefined;
onPointerMove?: PointerEventHandler<T> | undefined;
onPointerMoveCapture?: PointerEventHandler<T> | undefined;
onPointerUp?: PointerEventHandler<T> | undefined;
onPointerUpCapture?: PointerEventHandler<T> | undefined;
onPointerCancel?: PointerEventHandler<T> | undefined;
onPointerCancelCapture?: PointerEventHandler<T> | undefined;
onPointerEnter?: PointerEventHandler<T> | undefined;
onPointerLeave?: PointerEventHandler<T> | undefined;
onPointerOver?: PointerEventHandler<T> | undefined;
onPointerOverCapture?: PointerEventHandler<T> | undefined;
onPointerOut?: PointerEventHandler<T> | undefined;
onPointerOutCapture?: PointerEventHandler<T> | undefined;
onGotPointerCapture?: PointerEventHandler<T> | undefined;
onGotPointerCaptureCapture?: PointerEventHandler<T> | undefined;
onLostPointerCapture?: PointerEventHandler<T> | undefined;
onLostPointerCaptureCapture?: PointerEventHandler<T> | undefined;
onScroll?: UIEventHandler<T> | undefined;
onScrollCapture?: UIEventHandler<T> | undefined;
onWheel?: WheelEventHandler<T> | undefined;
onWheelCapture?: WheelEventHandler<T> | undefined;
onAnimationStart?: AnimationEventHandler<T> | undefined;
onAnimationStartCapture?: AnimationEventHandler<T> | undefined;
onAnimationEnd?: AnimationEventHandler<T> | undefined;
onAnimationEndCapture?: AnimationEventHandler<T> | undefined;
onAnimationIteration?: AnimationEventHandler<T> | undefined;
onAnimationIterationCapture?: AnimationEventHandler<T> | undefined;
onTransitionCancel?: TransitionEventHandler<T> | undefined;
onTransitionCancelCapture?: TransitionEventHandler<T> | undefined;
onTransitionEnd?: TransitionEventHandler<T> | undefined;
onTransitionEndCapture?: TransitionEventHandler<T> | undefined;
onTransitionRun?: TransitionEventHandler<T> | undefined;
onTransitionRunCapture?: TransitionEventHandler<T> | undefined;
onTransitionStart?: TransitionEventHandler<T> | undefined;
onTransitionStartCapture?: TransitionEventHandler<T> | undefined;
}
Referenced by
export interface FormProps extends AriaLabelingProps {

Validation errors for the form, typically returned by a server. This should be set to an object mapping from input names to errors.

validationErrors?: ValidationErrors;

Where to send the form-data when the form is submitted. See MDN.

action?: string | FormHTMLAttributes<HTMLFormElement>["action"];

The enctype attribute specifies how the form-data should be encoded when submitting it to the server. See MDN.

encType?: "application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain";

The HTTP method to submit the form with. See MDN.

method?: "get" | "post" | "dialog";

The target attribute specifies a name or a keyword that indicates where to display the response that is received after submitting the form. See MDN.

target?: "_blank" | "_self" | "_parent" | "_top";

Triggered when a user submits the form.

onSubmit?: (event: FormEvent<HTMLFormElement>) => void;

Triggered when a user resets the form.

onReset?: (event: FormEvent<HTMLFormElement>) => void;

Triggered for each invalid field when a user submits the form.

onInvalid?: (event: FormEvent<HTMLFormElement>) => void;

Indicates whether input elements can by default have their values automatically completed by the browser. See MDN.

autoComplete?: "off" | "on";

Controls whether inputted text is automatically capitalized and, if so, in what manner. See MDN.

autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters";

An ARIA role override to apply to the form element.

role?: "search" | "presentation";
}
export type ValidationState = "valid" | "invalid"
Referenced by
export type ValidationError = string | string[]
Referenced by
export type ValidationErrors = Record<string, ValidationError>
Referenced by
export type ValidationFunction<T> = (value: T) => ValidationError | true | null | undefined
export interface Validation<T = unknown> {

Whether user input is required on the input before form submission.

isRequired?: boolean;

Whether the input value is invalid.

isInvalid?: boolean;

@deprecated — Use isInvalid instead.

validationState?: ValidationState;

Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.

more
less

@default — 'aria'

validationBehavior?: "aria" | "native";

A function that returns an error message if a given value is invalid. Validation errors are displayed to the user when the form is submitted if validationBehavior="native". For realtime validation, use the isInvalid prop instead.

validate?: (value: T) => ValidationError | true | null | undefined;
}
Referenced by
export interface ValidationResult {

Whether the input value is invalid.

isInvalid: boolean;

The current error messages for the input if it is invalid, otherwise an empty array.

validationErrors: string[];

The native validation details for the input.

validationDetails: ValidityState;
}
Referenced by
export interface SpectrumFieldValidation<T> extends Omit<Validation<T>, "isInvalid" | "validationState"> {

Whether the input should display its "valid" or "invalid" visual styling.

validationState?: ValidationState;
}
export interface InputBase {

Whether the input is disabled.

isDisabled?: boolean;

Whether the input can be selected but not changed by the user.

isReadOnly?: boolean;
}
export interface ValueBase<T, C = T> {

The current value (controlled).

value?: T;

The default value (uncontrolled).

defaultValue?: T;

Handler that is called when the value changes.

onChange?: (value: C) => void;
}
export interface TextInputBase {

Temporary text that occupies the text input when it is empty.

placeholder?: string;
}
export interface SpectrumTextInputBase {

Temporary text that occupies the text input when it is empty. Please use help text instead.

more
less

@deprecated —

placeholder?: string;
}
export interface RangeValue<T> {

The start value of the range.

start: T;

The end value of the range.

end: T;
}
export interface RangeInputBase<T> {

The smallest value allowed for the input.

minValue?: T;

The largest value allowed for the input.

maxValue?: T;

The amount that the input value changes with each increment or decrement "tick".

step?: T;
}
export interface HelpTextProps {

A description for the field. Provides a hint such as specific requirements for what to choose.

description?: ReactNode;

An error message for the field.

errorMessage?: ReactNode | ((v: ValidationResult) => ReactNode);
}
Referenced by
export interface SpectrumHelpTextProps extends HelpTextProps {

Whether the description is displayed with lighter text.

isDisabled?: boolean;

Whether an error icon is rendered.

showErrorIcon?: boolean;
}
export interface SingleSelection {

Whether the collection allows empty selection.

disallowEmptySelection?: boolean;

The currently selected key in the collection (controlled).

selectedKey?: Key | null;

The initial selected key in the collection (uncontrolled).

defaultSelectedKey?: Key | null;

Handler that is called when the selection changes.

onSelectionChange?: (key: Key | null) => void;
}
export type SelectionMode = "none" | "single" | "multiple"
Referenced by
export type SelectionBehavior = "toggle" | "replace"
export type Selection = "all" | Set<Key>
Referenced by
export interface MultipleSelection {

The type of selection that is allowed in the collection.

selectionMode?: SelectionMode;

Whether the collection allows empty selection.

disallowEmptySelection?: boolean;

The currently selected keys in the collection (controlled).

selectedKeys?: "all" | Iterable<Key>;

The initial selected keys in the collection (uncontrolled).

defaultSelectedKeys?: "all" | Iterable<Key>;

Handler that is called when the selection changes.

onSelectionChange?: (keys: Selection) => void;

The currently disabled keys in the collection (controlled).

disabledKeys?: Iterable<Key>;
}
export interface SpectrumSelectionProps {

How selection should be displayed.

selectionStyle?: "checkbox" | "highlight";
}
export type FocusStrategy = "first" | "last"
export type DisabledBehavior = "selection" | "all"
export interface DragDropEvent {

The x coordinate of the event, relative to the target element.

x: number;

The y coordinate of the event, relative to the target element.

y: number;
}
Referenced by
export interface DragItem {
[key: string]: string;
}
Referenced by
export interface DragStartEvent extends DragDropEvent {

The event type.

type: "dragstart";
}
Referenced by
export interface DragMoveEvent extends DragDropEvent {

The event type.

type: "dragmove";
}
Referenced by
export interface DragEndEvent extends DragDropEvent {

The event type.

type: "dragend";

The drop operation that occurred.

dropOperation: DropOperation;
}
Referenced by
export interface DropEnterEvent extends DragDropEvent {

The event type.

type: "dropenter";
}
Referenced by
export interface DropMoveEvent extends DragDropEvent {

The event type.

type: "dropmove";
}
Referenced by
export interface DropActivateEvent extends DragDropEvent {

The event type.

type: "dropactivate";
}
Referenced by
export interface DropExitEvent extends DragDropEvent {

The event type.

type: "dropexit";
}
Referenced by
export interface TextDropItem {

The item kind.

kind: "text";

The drag types available for this item. These are often mime types, but may be custom app-specific types.

types: Set<string>;

Returns the data for the given type as a string.

getText(type: string): Promise<string>;
}
Referenced by
export interface FileDropItem {

The item kind.

kind: "file";

The file type (usually a mime type).

type: string;

The file name.

name: string;

Returns the contents of the file as a blob.

getFile(): Promise<File>;

Returns the contents of the file as a string.

getText(): Promise<string>;
}
Referenced by
export interface DirectoryDropItem {

The item kind.

kind: "directory";

The directory name.

name: string;

Returns the entries contained within the directory.

getEntries(): AsyncIterable<FileDropItem | DirectoryDropItem>;
}
Referenced by
export interface DropEvent extends DragDropEvent {

The event type.

type: "drop";

The drop operation that should occur.

dropOperation: DropOperation;

The dropped items.

items: DropItem[];
}
Referenced by
export type DropPosition = "on" | "before" | "after"
Referenced by
export interface RootDropTarget {

The event type.

type: "root";
}
Referenced by
export interface ItemDropTarget {

The drop target type.

type: "item";

The item key.

key: Key;

The drop position relative to the item.

dropPosition: DropPosition;
}
Referenced by
export interface DroppableCollectionEnterEvent extends DropEnterEvent {

The drop target.

target: DropTarget;
}
Referenced by
export interface DroppableCollectionMoveEvent extends DropMoveEvent {

The drop target.

target: DropTarget;
}
export interface DroppableCollectionActivateEvent extends DropActivateEvent {

The drop target.

target: DropTarget;
}
Referenced by
export interface DroppableCollectionExitEvent extends DropExitEvent {

The drop target.

target: DropTarget;
}
Referenced by
export interface DroppableCollectionDropEvent extends DropEvent {

The drop target.

target: DropTarget;
}
Referenced by
export interface DroppableCollectionInsertDropEvent {

The dropped items.

items: DropItem[];

The drop operation that should occur.

dropOperation: DropOperation;

The drop target.

target: ItemDropTarget;
}
Referenced by
export interface DroppableCollectionRootDropEvent {

The dropped items.

items: DropItem[];

The drop operation that should occur.

dropOperation: DropOperation;
}
Referenced by
export interface DroppableCollectionOnItemDropEvent {

The dropped items.

items: DropItem[];

The drop operation that should occur.

dropOperation: DropOperation;

Whether the drag originated within the same collection as the drop.

isInternal: boolean;

The drop target.

target: ItemDropTarget;
}
Referenced by
export interface DroppableCollectionReorderEvent {

The keys of the items that were reordered.

keys: Set<Key>;

The drop operation that should occur.

dropOperation: DropOperation;

The drop target.

target: ItemDropTarget;
}
Referenced by
export type DragType = string | symbol
Referenced by
export interface DragTypes {

Returns whether the drag contains data of the given type.

has(type: DragType | DragType[]): boolean;
}
Referenced by
export interface DropTargetDelegate {

Returns a drop target within a collection for the given x and y coordinates. The point is provided relative to the top left corner of the collection container. A drop target can be checked to see if it is valid using the provided isValidDropTarget function.

getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget | null;
}
export interface DroppableCollectionUtilityOptions {

The drag types that the droppable collection accepts. If the collection accepts directories, include DIRECTORY_DRAG_TYPE in your array of allowed types.

more
less

@default — 'all'

acceptedDragTypes?: "all" | string | symbol[];

Handler that is called when external items are dropped "between" items.

onInsert?: (e: DroppableCollectionInsertDropEvent) => void;

Handler that is called when external items are dropped on the droppable collection's root.

onRootDrop?: (e: DroppableCollectionRootDropEvent) => void;

Handler that is called when items are dropped "on" an item.

onItemDrop?: (e: DroppableCollectionOnItemDropEvent) => void;

Handler that is called when items are reordered within the collection. This handler only allows dropping between items, not on items. It does not allow moving items to a different parent item within a tree.

onReorder?: (e: DroppableCollectionReorderEvent) => void;

Handler that is called when items are moved within the source collection. This handler allows dropping both on or between items, and items may be moved to a different parent item within a tree.

onMove?: (e: DroppableCollectionReorderEvent) => void;

A function returning whether a given target in the droppable collection is a valid "on" drop target for the current drag types.

shouldAcceptItemDrop?: (target: ItemDropTarget, types: DragTypes) => boolean;
}
Referenced by
export interface DroppableCollectionBaseProps {

Handler that is called when a valid drag enters a drop target.

onDropEnter?: (e: DroppableCollectionEnterEvent) => void;

Handler that is called after a valid drag is held over a drop target for a period of time.

onDropActivate?: (e: DroppableCollectionActivateEvent) => void;

Handler that is called when a valid drag exits a drop target.

onDropExit?: (e: DroppableCollectionExitEvent) => void;

Handler that is called when a valid drag is dropped on a drop target. When defined, this overrides other drop handlers such as onInsert, and onItemDrop.

onDrop?: (e: DroppableCollectionDropEvent) => void;

A function returning the drop operation to be performed when items matching the given types are dropped on the drop target.

getDropOperation?: (target: DropTarget, types: DragTypes, allowedOperations: DropOperation[]) => DropOperation;
}
Referenced by
export interface DraggableCollectionStartEvent extends DragStartEvent {

The keys of the items that were dragged.

keys: Set<Key>;
}
Referenced by
export interface DraggableCollectionMoveEvent extends DragMoveEvent {

The keys of the items that were dragged.

keys: Set<Key>;
}
Referenced by
export interface DraggableCollectionEndEvent extends DragEndEvent {

The keys of the items that were dragged.

keys: Set<Key>;

Whether the drop ended within the same collection as it originated.

isInternal: boolean;
}
Referenced by
export type DragPreviewRenderer = (items: DragItem[], callback: (node: HTMLElement | null, x?: number, y?: number) => void) => void
Referenced by
export interface DraggableCollectionProps<T = object> {

Handler that is called when a drag operation is started.

onDragStart?: (e: DraggableCollectionStartEvent) => void;

Handler that is called when the drag is moved.

onDragMove?: (e: DraggableCollectionMoveEvent) => void;

Handler that is called when the drag operation is ended, either as a result of a drop or a cancellation.

onDragEnd?: (e: DraggableCollectionEndEvent) => void;

A function that returns the items being dragged.

getItems: (keys: Set<Key>, items: T[]) => DragItem[];

The ref of the element that will be rendered as the drag preview while dragging.

preview?: RefObject<DragPreviewRenderer | null>;

Function that returns the drop operations that are allowed for the dragged items. If not provided, all drop operations are allowed.

getAllowedDropOperations?: () => DropOperation[];
}
export interface ItemProps<T> extends LinkDOMProps {

Rendered contents of the item or child items.

children: ReactNode;

Rendered contents of the item if children contains child items.

title?: ReactNode;

A string representation of the item's contents, used for features like typeahead.

textValue?: string;

An accessibility label for this item.

'aria-label'?: string;

A list of child item objects. Used for dynamic collections.

childItems?: Iterable<T>;

Whether this item has children, even if not loaded yet.

hasChildItems?: boolean;
}
Referenced by
export type ItemElement<T> = ReactElement<ItemProps<T>> | null
Referenced by
export type ItemRenderer<T> = (item: T) => ItemElement<T>
Referenced by
export type LoadingState = "loading" | "sorting" | "loadingMore" | "error" | "idle" | "filtering"
export interface AsyncLoadable {

Whether the items are currently loading.

isLoading?: boolean;

Handler that is called when more items should be loaded, e.g. while scrolling near the bottom.

onLoadMore?: () => any;
}
export interface SectionProps<T> {

Rendered contents of the section, e.g. a header.

title?: ReactNode;

An accessibility label for the section.

'aria-label'?: string;

Static child items or a function to render children.

children: ItemElement<T> | ItemElement<T>[] | ItemRenderer<T>;

Item objects in the section.

items?: Iterable<T>;
}
Referenced by
export type SectionElement<T> = ReactElement<SectionProps<T>> | null
Referenced by
export type CollectionElement<T> = SectionElement<T> | ItemElement<T>
Referenced by
export type CollectionChildren<T> = CollectionElement<T> | CollectionElement<T>[] | ((item: T) => CollectionElement<T>)
Referenced by
export interface CollectionBase<T> {

The contents of the collection.

children: CollectionChildren<T>;

Item objects in the collection.

items?: Iterable<T>;

The item keys that are disabled. These items cannot be selected, focused, or otherwise interacted with.

disabledKeys?: Iterable<Key>;
}
Referenced by
export interface CollectionStateBase<T, C extends Collection<Node<T>> = Collection<Node<T>>> extends Partial<CollectionBase<T>> {

A pre-constructed collection to use instead of building one from items and children.

collection?: C;
}
export interface Expandable {

The currently expanded keys in the collection (controlled).

expandedKeys?: Iterable<Key>;

The initial expanded keys in the collection (uncontrolled).

defaultExpandedKeys?: Iterable<Key>;

Handler that is called when items are expanded or collapsed.

onExpandedChange?: (keys: Set<Key>) => any;
}
export interface Sortable {

The current sorted column and direction.

sortDescriptor?: SortDescriptor;

Handler that is called when the sorted column or direction changes.

onSortChange?: (descriptor: SortDescriptor) => any;
}
export interface SortDescriptor {

The key of the column to sort by.

column: Key;

The direction to sort by.

direction: SortDirection;
}
Referenced by
export type SortDirection = "ascending" | "descending"
Referenced by
export interface KeyboardDelegate {

Returns the key visually below the given one, or null for none.

getKeyBelow(key: Key, options?: {
includeDisabled?: boolean;
}): Key | null;

Returns the key visually above the given one, or null for none.

getKeyAbove(key: Key, options?: {
includeDisabled?: boolean;
}): Key | null;

Returns the key visually to the left of the given one, or null for none.

getKeyLeftOf(key: Key, options?: {
includeDisabled?: boolean;
}): Key | null;

Returns the key visually to the right of the given one, or null for none.

getKeyRightOf(key: Key, options?: {
includeDisabled?: boolean;
}): Key | null;

Returns the key visually one page below the given one, or null for none.

getKeyPageBelow(key: Key): Key | null;

Returns the key visually one page above the given one, or null for none.

getKeyPageAbove(key: Key): Key | null;

Returns the first key, or null for none.

getFirstKey(key?: Key | null, global?: boolean): Key | null;

Returns the last key, or null for none.

getLastKey(key?: Key | null, global?: boolean): Key | null;

Returns the next key after fromKey that matches the given search string, or null for none.

getKeyForSearch(search: string, fromKey?: Key | null): Key | null;
}
export interface Rect {
x: number;
y: number;
width: number;
height: number;
}
Referenced by
export interface Size {
width: number;
height: number;
}
Referenced by

A LayoutDelegate provides layout information for collection items.

export interface LayoutDelegate {

Returns a rectangle for the item with the given key.

getItemRect(key: Key): Rect | null;

Returns the visible rectangle of the collection.

getVisibleRect(): Rect;

Returns the size of the scrollable content in the collection.

getContentSize(): Size;

Returns a list of keys between from and to.

getKeyRange(from: Key, to: Key): Key[];
}

A generic interface to access a readonly sequential collection of unique keyed items.

export interface Collection<T> extends Iterable<T> {

The number of items in the collection.

readonly size: number;

Iterate over all keys in the collection.

getKeys(): Iterable<Key>;

Get an item by its key.

getItem(key: Key): T | null;

Get an item by the index of its key.

at(idx: number): T | null;

Get the key that comes before the given key in the collection.

getKeyBefore(key: Key): Key | null;

Get the key that comes after the given key in the collection.

getKeyAfter(key: Key): Key | null;

Get the first key in the collection.

getFirstKey(): Key | null;

Get the last key in the collection.

getLastKey(): Key | null;

Iterate over the child items of the given key.

getChildren(key: Key): Iterable<T>;

Returns a string representation of the item's contents.

getTextValue(key: Key): string;

Filters the collection using the given function.

filter(filterFn: (nodeValue: string, node: T) => boolean): Collection<T>;
}
Referenced by
export interface Node<T> {

The type of item this node represents.

type: string;

A unique key for the node.

key: Key;

The object value the node was created from.

value: T | null;

The level of depth this node is at in the hierarchy.

level: number;

Whether this item has children, even if not loaded yet.

hasChildNodes: boolean;

The loaded children of this node.

more
less

@deprecated — Use collection.getChildren(node.key) instead.

childNodes: Iterable<Node<T>>;

The rendered contents of this node (e.g. JSX).

rendered: ReactNode;

A string value for this node, used for features like typeahead.

textValue: string;

An accessibility label for this node.

'aria-label'?: string;

The index of this node within its parent.

index: number;

A function that should be called to wrap the rendered node.

wrapper?: (element: ReactElement) => ReactElement;

The key of the parent node.

parentKey?: Key | null;

The key of the node before this node.

prevKey?: Key | null;

The key of the node after this node.

nextKey?: Key | null;

The first child key of this node.

firstChildKey?: Key | null;

The last child key of this node.

lastChildKey?: Key | null;

Additional properties specific to a particular node type.

props?: any;

@private —

shouldInvalidate?: (context: any) => boolean;

A function that renders this node to a React Element in the DOM.

render?: (node: Node<any>) => ReactElement;
}
Referenced by
export interface Removable<T, R> {
isRemovable?: boolean;
onRemove?: (value: T, event?: SyntheticEvent) => R;
}
export type EventTargetType<T> = T extends SyntheticEvent<infer E, any> ? E : EventTarget
export type EventMapType<T extends EventTarget> = T extends Window ? WindowEventMap : T extends Document ? DocumentEventMap : T extends Element ? HTMLElementEventMap : T extends VisualViewport ? VisualViewportEventMap : GlobalEventHandlersEventMap
export type BaseEvent<T extends SyntheticEvent> = T & {

Use continuePropagation.

more
less

@deprecated —

stopPropagation(): void;
continuePropagation(): void;
}
Referenced by
export type KeyboardEvent = BaseEvent<ReactKeyboardEvent<any>>
Referenced by
export type PointerType = "mouse" | "pen" | "touch" | "keyboard" | "virtual"
Referenced by
export interface PressEvent {

The type of press event being fired.

type: "pressstart" | "pressend" | "pressup" | "press";

The pointer type that triggered the press event.

pointerType: PointerType;

The target element of the press event.

target: Element;

Whether the shift keyboard modifier was held during the press event.

shiftKey: boolean;

Whether the ctrl keyboard modifier was held during the press event.

ctrlKey: boolean;

Whether the meta keyboard modifier was held during the press event.

metaKey: boolean;

Whether the alt keyboard modifier was held during the press event.

altKey: boolean;

X position relative to the target.

x: number;

Y position relative to the target.

y: number;

The key that triggered the press event, if it was triggered by a keyboard interaction. This is useful for differentiating between Space and Enter key presses.

key?: string;

By default, press events stop propagation to parent elements. In cases where a handler decides not to handle a specific event, it can call continuePropagation() to allow a parent to handle it.

continuePropagation(): void;
}
Referenced by
export interface LongPressEvent extends Omit<PressEvent, "type" | "continuePropagation"> {

The type of long press event being fired.

type: "longpressstart" | "longpressend" | "longpress";
}
export interface HoverEvent {

The type of hover event being fired.

type: "hoverstart" | "hoverend";

The pointer type that triggered the hover event.

pointerType: "mouse" | "pen";

The target element of the hover event.

target: HTMLElement;
}
Referenced by
export interface KeyboardEvents {

Handler that is called when a key is pressed.

onKeyDown?: (e: KeyboardEvent) => void;

Handler that is called when a key is released.

onKeyUp?: (e: KeyboardEvent) => void;
}
Referenced by
export interface FocusEvents<Target = Element> {

Handler that is called when the element receives focus.

onFocus?: (e: FocusEvent<Target>) => void;

Handler that is called when the element loses focus.

onBlur?: (e: FocusEvent<Target>) => void;

Handler that is called when the element's focus status changes.

onFocusChange?: (isFocused: boolean) => void;
}
Referenced by
export interface HoverEvents {

Handler that is called when a hover interaction starts.

onHoverStart?: (e: HoverEvent) => void;

Handler that is called when a hover interaction ends.

onHoverEnd?: (e: HoverEvent) => void;

Handler that is called when the hover state changes.

onHoverChange?: (isHovering: boolean) => void;
}
export interface PressEvents {

Handler that is called when the press is released over the target.

onPress?: (e: PressEvent) => void;

Handler that is called when a press interaction starts.

onPressStart?: (e: PressEvent) => void;

Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.

onPressEnd?: (e: PressEvent) => void;

Handler that is called when the press state changes.

onPressChange?: (isPressed: boolean) => void;

Handler that is called when a press is released over the target, regardless of whether it started on the target or not.

onPressUp?: (e: PressEvent) => void;

Not recommended – use onPress instead. onClick is an alias for onPress provided for compatibility with other libraries. onPress provides additional event details for non-mouse interactions.

onClick?: (e: MouseEvent<FocusableElement>) => void;
}
export interface FocusableProps<Target = Element> extends FocusEvents<Target>, KeyboardEvents {

Whether the element should receive focus on render.

autoFocus?: boolean;
}
export interface BaseMoveEvent {

The pointer type that triggered the move event.

pointerType: PointerType;

Whether the shift keyboard modifier was held during the move event.

shiftKey: boolean;

Whether the ctrl keyboard modifier was held during the move event.

ctrlKey: boolean;

Whether the meta keyboard modifier was held during the move event.

metaKey: boolean;

Whether the alt keyboard modifier was held during the move event.

altKey: boolean;
}
Referenced by
export interface MoveStartEvent extends BaseMoveEvent {

The type of move event being fired.

type: "movestart";
}
Referenced by
export interface MoveMoveEvent extends BaseMoveEvent {

The type of move event being fired.

type: "move";

The amount moved in the X direction since the last event.

deltaX: number;

The amount moved in the Y direction since the last event.

deltaY: number;
}
Referenced by
export interface MoveEndEvent extends BaseMoveEvent {

The type of move event being fired.

type: "moveend";
}
Referenced by
export interface MoveEvents {

Handler that is called when a move interaction starts.

onMoveStart?: (e: MoveStartEvent) => void;

Handler that is called when the element is moved.

onMove?: (e: MoveMoveEvent) => void;

Handler that is called when a move interaction ends.

onMoveEnd?: (e: MoveEndEvent) => void;
}
export interface ScrollEvent {

The amount moved in the X direction since the last event.

deltaX: number;

The amount moved in the Y direction since the last event.

deltaY: number;
}
Referenced by
export interface ScrollEvents {

Handler that is called when the scroll wheel moves.

onScroll?: (e: ScrollEvent) => void;
}

See the Styling docs for a visualization of these values.

export type DimensionValue = "size-0" | "size-10" | "size-25" | "size-40" | "size-50" | "size-65" | "size-75" | "size-85" | "size-100" | "size-115" | "size-125" | "size-130" | "size-150" | "size-160" | "size-175" | "size-200" | "size-225" | "size-250" | "size-275" | "size-300" | "size-325" | "size-350" | "size-400" | "size-450" | "size-500" | "size-550" | "size-600" | "size-675" | "size-700" | "size-800" | "size-900" | "size-1000" | "size-1200" | "size-1250" | "size-1600" | "size-1700" | "size-2000" | "size-2400" | "size-3000" | "size-3400" | "size-3600" | "size-4600" | "size-5000" | "size-6000" | "static-size-0" | "static-size-10" | "static-size-25" | "static-size-50" | "static-size-40" | "static-size-65" | "static-size-100" | "static-size-115" | "static-size-125" | "static-size-130" | "static-size-150" | "static-size-160" | "static-size-175" | "static-size-200" | "static-size-225" | "static-size-250" | "static-size-300" | "static-size-400" | "static-size-450" | "static-size-500" | "static-size-550" | "static-size-600" | "static-size-700" | "static-size-800" | "static-size-900" | "static-size-1000" | "static-size-1200" | "static-size-1700" | "static-size-2400" | "static-size-2600" | "static-size-3400" | "static-size-3600" | "static-size-4600" | "static-size-5000" | "static-size-6000" | "single-line-height" | "single-line-width" | (string & {}) | number
Referenced by
export type ColorValue = "celery-400" | "celery-500" | "celery-600" | "celery-700" | "chartreuse-400" | "chartreuse-500" | "chartreuse-600" | "chartreuse-700" | "yellow-400" | "yellow-500" | "yellow-600" | "yellow-700" | "magenta-400" | "magenta-500" | "magenta-600" | "magenta-700" | "fuchsia-400" | "fuchsia-500" | "fuchsia-600" | "fuchsia-700" | "purple-400" | "purple-500" | "purple-600" | "purple-700" | "indigo-400" | "indigo-500" | "indigo-600" | "indigo-700" | "seafoam-400" | "seafoam-500" | "seafoam-600" | "seafoam-700" | "red-400" | "red-500" | "red-600" | "red-700" | "orange-400" | "orange-500" | "orange-600" | "orange-700" | "green-400" | "green-500" | "green-600" | "green-700" | "blue-400" | "blue-500" | "blue-600" | "blue-700" | "gray-50" | "gray-75" | "gray-100" | "gray-200" | "gray-300" | "gray-400" | "gray-500" | "gray-600" | "gray-700" | "gray-800" | "gray-900" | "static-black" | "static-white" | "static-blue" | "static-gray-50" | "static-gray-75" | "static-gray-100" | "static-gray-200" | "static-gray-300" | "static-gray-400" | "static-gray-500" | "static-gray-600" | "static-gray-700" | "static-gray-800" | "static-gray-900" | "static-blue-200" | "static-blue-300" | "static-blue-400" | "static-blue-500" | "static-blue-600" | "static-blue-700" | "static-blue-800" | "static-red-400" | "static-red-500" | "static-red-600" | "static-red-700" | "static-orange-400" | "static-orange-500" | "static-orange-600" | "static-orange-700" | "static-green-400" | "static-green-500" | "static-green-600" | "static-green-700" | "static-celery-200" | "static-celery-300" | "static-celery-400" | "static-celery-500" | "static-celery-600" | "static-celery-700" | "static-chartreuse-300" | "static-chartreuse-400" | "static-chartreuse-500" | "static-chartreuse-600" | "static-chartreuse-700" | "static-yellow-200" | "static-yellow-300" | "static-yellow-400" | "static-yellow-500" | "static-yellow-600" | "static-yellow-700" | "static-magenta-200" | "static-magenta-300" | "static-magenta-400" | "static-magenta-500" | "static-magenta-600" | "static-magenta-700" | "static-fuchsia-400" | "static-fuchsia-500" | "static-fuchsia-600" | "static-fuchsia-700" | "static-purple-400" | "static-purple-500" | "static-purple-600" | "static-purple-700" | "static-purple-800" | "static-indigo-200" | "static-indigo-300" | "static-indigo-400" | "static-indigo-500" | "static-indigo-600" | "static-indigo-700" | "static-seafoam-200" | "static-seafoam-300" | "static-seafoam-400" | "static-seafoam-500" | "static-seafoam-600" | "static-seafoam-700" | SemanticColorValue
Referenced by
export type ColorValueV6 = "gray-50" | "gray-75" | "gray-100" | "gray-200" | "gray-300" | "gray-400" | "gray-500" | "gray-600" | "gray-700" | "gray-800" | "gray-900" | "red-100" | "red-200" | "red-300" | "red-400" | "red-500" | "red-600" | "red-700" | "red-800" | "red-900" | "red-1000" | "red-1100" | "red-1200" | "red-1300" | "red-1400" | "orange-100" | "orange-200" | "orange-300" | "orange-400" | "orange-500" | "orange-600" | "orange-700" | "orange-800" | "orange-900" | "orange-1000" | "orange-1100" | "orange-1200" | "orange-1300" | "orange-1400" | "yellow-100" | "yellow-200" | "yellow-300" | "yellow-400" | "yellow-500" | "yellow-600" | "yellow-700" | "yellow-800" | "yellow-900" | "yellow-1000" | "yellow-1100" | "yellow-1200" | "yellow-1300" | "yellow-1400" | "chartreuse-100" | "chartreuse-200" | "chartreuse-300" | "chartreuse-400" | "chartreuse-500" | "chartreuse-600" | "chartreuse-700" | "chartreuse-800" | "chartreuse-900" | "chartreuse-1000" | "chartreuse-1100" | "chartreuse-1200" | "chartreuse-1300" | "chartreuse-1400" | "celery-100" | "celery-200" | "celery-300" | "celery-400" | "celery-500" | "celery-600" | "celery-700" | "celery-800" | "celery-900" | "celery-1000" | "celery-1100" | "celery-1200" | "celery-1300" | "celery-1400" | "green-100" | "green-200" | "green-300" | "green-400" | "green-500" | "green-600" | "green-700" | "green-800" | "green-900" | "green-1000" | "green-1100" | "green-1200" | "green-1300" | "green-1400" | "seafoam-100" | "seafoam-200" | "seafoam-300" | "seafoam-400" | "seafoam-500" | "seafoam-600" | "seafoam-700" | "seafoam-800" | "seafoam-900" | "seafoam-1000" | "seafoam-1100" | "seafoam-1200" | "seafoam-1300" | "seafoam-1400" | "cyan-100" | "cyan-200" | "cyan-300" | "cyan-400" | "cyan-500" | "cyan-600" | "cyan-700" | "cyan-800" | "cyan-900" | "cyan-1000" | "cyan-1100" | "cyan-1200" | "cyan-1300" | "cyan-1400" | "blue-100" | "blue-200" | "blue-300" | "blue-400" | "blue-500" | "blue-600" | "blue-700" | "blue-800" | "blue-900" | "blue-1000" | "blue-1100" | "blue-1200" | "blue-1300" | "blue-1400" | "indigo-100" | "indigo-200" | "indigo-300" | "indigo-400" | "indigo-500" | "indigo-600" | "indigo-700" | "indigo-800" | "indigo-900" | "indigo-1000" | "indigo-1100" | "indigo-1200" | "indigo-1300" | "indigo-1400" | "purple-100" | "purple-200" | "purple-300" | "purple-400" | "purple-500" | "purple-600" | "purple-700" | "purple-800" | "purple-900" | "purple-1000" | "purple-1100" | "purple-1200" | "purple-1300" | "purple-1400" | "fuchsia-100" | "fuchsia-200" | "fuchsia-300" | "fuchsia-400" | "fuchsia-500" | "fuchsia-600" | "fuchsia-700" | "fuchsia-800" | "fuchsia-900" | "fuchsia-1000" | "fuchsia-1100" | "fuchsia-1200" | "fuchsia-1300" | "fuchsia-1400" | "magenta-100" | "magenta-200" | "magenta-300" | "magenta-400" | "magenta-500" | "magenta-600" | "magenta-700" | "magenta-800" | "magenta-900" | "magenta-1000" | "magenta-1100" | "magenta-1200" | "magenta-1300" | "magenta-1400" | SemanticColorValue
Referenced by
export type SemanticColorValue = "negative" | "notice" | "positive" | "informative"
Referenced by
export type BorderColorAlias = "negative" | "notice" | "positive" | "informative" | "hover" | "down" | "focus" | "mouse-focus" | "disabled" | "extralight" | "light" | "mid" | "dark" | "transparent" | "translucent-dark" | "translucent-darker"
Referenced by
export type BackgroundColorAlias = "default" | "disabled" | "transparent" | "label-gray"
Referenced by
export type IconColorValue = "negative" | "notice" | "positive" | "informative"
export type BorderSizeValue = "thin" | "thick" | "thicker" | "thickest" | "none"
Referenced by
export type BorderRadiusValue = "xsmall" | "small" | "regular" | "medium" | "large"
Referenced by
export type BorderColorValue = "default" | BorderColorAlias | ColorValue
Referenced by
export type BorderColorValueV6 = BorderColorAlias | ColorValueV6
Referenced by
export type BackgroundColorValue = BackgroundColorAlias | ColorValue
Referenced by
export type BackgroundColorValueV6 = BackgroundColorAlias | ColorValueV6
Referenced by
export type ResponsiveProp<T> = {
base?: T;
S?: T;
M?: T;
L?: T;
[key: string]: T | undefined;
}
Referenced by
export interface StyleProps {

Sets the CSS className for the element. Only use as a last resort. Use style props instead.

UNSAFE_className?: string;

Sets inline style for the element. Only use as a last resort. Use style props instead.

UNSAFE_style?: CSSProperties;

The margin for all four sides of the element. See MDN.

margin?: Responsive<DimensionValue>;

The margin for the logical start side of the element, depending on layout direction. See MDN.

marginStart?: Responsive<DimensionValue>;

The margin for the logical end side of an element, depending on layout direction. See MDN.

marginEnd?: Responsive<DimensionValue>;

The margin for the top side of the element. See MDN.

marginTop?: Responsive<DimensionValue>;

The margin for the bottom side of the element. See MDN.

marginBottom?: Responsive<DimensionValue>;

The margin for both the left and right sides of the element. See MDN.

marginX?: Responsive<DimensionValue>;

The margin for both the top and bottom sides of the element. See MDN.

marginY?: Responsive<DimensionValue>;

The width of the element. See MDN.

width?: Responsive<DimensionValue>;

The height of the element. See MDN.

height?: Responsive<DimensionValue>;

The minimum width of the element. See MDN.

minWidth?: Responsive<DimensionValue>;

The minimum height of the element. See MDN.

minHeight?: Responsive<DimensionValue>;

The maximum width of the element. See MDN.

maxWidth?: Responsive<DimensionValue>;

The maximum height of the element. See MDN.

maxHeight?: Responsive<DimensionValue>;

When used in a flex layout, specifies how the element will grow or shrink to fit the space available. See MDN.

flex?: Responsive<string | number | boolean>;

When used in a flex layout, specifies how the element will grow to fit the space available. See MDN.

flexGrow?: Responsive<number>;

When used in a flex layout, specifies how the element will shrink to fit the space available. See MDN.

flexShrink?: Responsive<number>;

When used in a flex layout, specifies the initial main size of the element. See MDN.

flexBasis?: Responsive<number | string>;

Specifies how the element is justified inside a flex or grid container. See MDN.

justifySelf?: Responsive<"auto" | "normal" | "start" | "end" | "flex-start" | "flex-end" | "self-start" | "self-end" | "center" | "left" | "right" | "stretch">;

Overrides the alignItems property of a flex or grid container. See MDN.

alignSelf?: Responsive<"auto" | "normal" | "start" | "end" | "center" | "flex-start" | "flex-end" | "self-start" | "self-end" | "stretch">;

The layout order for the element within a flex or grid container. See MDN.

order?: Responsive<number>;

When used in a grid layout, specifies the named grid area that the element should be placed in within the grid. See MDN.

gridArea?: Responsive<string>;

When used in a grid layout, specifies the column the element should be placed in within the grid. See MDN.

gridColumn?: Responsive<string>;

When used in a grid layout, specifies the row the element should be placed in within the grid. See MDN.

gridRow?: Responsive<string>;

When used in a grid layout, specifies the starting column to span within the grid. See MDN.

gridColumnStart?: Responsive<string>;

When used in a grid layout, specifies the ending column to span within the grid. See MDN.

gridColumnEnd?: Responsive<string>;

When used in a grid layout, specifies the starting row to span within the grid. See MDN.

gridRowStart?: Responsive<string>;

When used in a grid layout, specifies the ending row to span within the grid. See MDN.

gridRowEnd?: Responsive<string>;

Specifies how the element is positioned. See MDN.

position?: Responsive<"static" | "relative" | "absolute" | "fixed" | "sticky">;

The stacking order for the element. See MDN.

zIndex?: Responsive<number>;

The top position for the element. See MDN.

top?: Responsive<DimensionValue>;

The bottom position for the element. See MDN.

bottom?: Responsive<DimensionValue>;

The logical start position for the element, depending on layout direction. See MDN.

start?: Responsive<DimensionValue>;

The logical end position for the element, depending on layout direction. See MDN.

end?: Responsive<DimensionValue>;

The left position for the element. See MDN. Consider using start instead for RTL support.

left?: Responsive<DimensionValue>;

The right position for the element. See MDN. Consider using start instead for RTL support.

right?: Responsive<DimensionValue>;

Hides the element.

isHidden?: Responsive<boolean>;
}
Referenced by
export type ColorVersion = 5 | 6
Referenced by
export type BackgroundColor = { }
Referenced by
export type BorderColor = { }
Referenced by
export interface ViewStyleProps<C extends ColorVersion> extends StyleProps {

The Spectrum color token version number.

more
less

@default — 5

colorVersion?: C;

The background color for the element.

backgroundColor?: Responsive<BackgroundColor[C]>;

The width of the element's border on all four sides. See MDN.

borderWidth?: Responsive<BorderSizeValue>;

The width of the border on the logical start side, depending on the layout direction. See MDN.

borderStartWidth?: Responsive<BorderSizeValue>;

The width of the border on the logical end side, depending on the layout direction. See MDN.

borderEndWidth?: Responsive<BorderSizeValue>;

The width of the top border. See MDN.

borderTopWidth?: Responsive<BorderSizeValue>;

The width of the bottom border. See MDN.

borderBottomWidth?: Responsive<BorderSizeValue>;

The width of the left and right borders. See MDN.

borderXWidth?: Responsive<BorderSizeValue>;

The width of the top and bottom borders. See MDN.

borderYWidth?: Responsive<BorderSizeValue>;

The color of the element's border on all four sides. See MDN.

borderColor?: Responsive<BorderColor[C]>;

The color of the border on the logical start side, depending on the layout direction. See MDN.

borderStartColor?: Responsive<BorderColor[C]>;

The color of the border on the logical end side, depending on the layout direction. See MDN.

borderEndColor?: Responsive<BorderColor[C]>;

The color of the top border. See MDN.

borderTopColor?: Responsive<BorderColor[C]>;

The color of the bottom border. See MDN.

borderBottomColor?: Responsive<BorderColor[C]>;

The color of the left and right borders. See MDN.

borderXColor?: Responsive<BorderColor[C]>;

The color of the top and bottom borders. See MDN.

borderYColor?: Responsive<BorderColor[C]>;

The border radius on all four sides of the element. See MDN.

borderRadius?: Responsive<BorderRadiusValue>;

The border radius for the top start corner of the element, depending on the layout direction. See MDN.

borderTopStartRadius?: Responsive<BorderRadiusValue>;

The border radius for the top end corner of the element, depending on the layout direction. See MDN.

borderTopEndRadius?: Responsive<BorderRadiusValue>;

The border radius for the bottom start corner of the element, depending on the layout direction. See MDN.

borderBottomStartRadius?: Responsive<BorderRadiusValue>;

The border radius for the bottom end corner of the element, depending on the layout direction. See MDN.

borderBottomEndRadius?: Responsive<BorderRadiusValue>;

The padding for all four sides of the element. See MDN.

padding?: Responsive<DimensionValue>;

The padding for the logical start side of the element, depending on layout direction. See MDN.

paddingStart?: Responsive<DimensionValue>;

The padding for the logical end side of an element, depending on layout direction. See MDN.

paddingEnd?: Responsive<DimensionValue>;

The padding for the top side of the element. See MDN.

paddingTop?: Responsive<DimensionValue>;

The padding for the bottom side of the element. See MDN.

paddingBottom?: Responsive<DimensionValue>;

The padding for both the left and right sides of the element. See MDN.

paddingX?: Responsive<DimensionValue>;

The padding for both the top and bottom sides of the element. See MDN.

paddingY?: Responsive<DimensionValue>;

Species what to do when the element's content is too long to fit its size. See MDN.

overflow?: Responsive<string>;
}
export interface BoxAlignmentStyleProps {

The distribution of space around items along the main axis. See MDN.

justifyContent?: Responsive<"start" | "end" | "center" | "left" | "right" | "space-between" | "space-around" | "space-evenly" | "stretch" | "baseline" | "first baseline" | "last baseline" | "safe center" | "unsafe center">;

The distribution of space around child items along the cross axis. See MDN.

alignContent?: Responsive<"start" | "end" | "center" | "space-between" | "space-around" | "space-evenly" | "stretch" | "baseline" | "first baseline" | "last baseline" | "safe center" | "unsafe center">;

The alignment of children within their container. See MDN.

alignItems?: Responsive<"start" | "end" | "center" | "stretch" | "self-start" | "self-end" | "baseline" | "first baseline" | "last baseline" | "safe center" | "unsafe center">;

The space to display between both rows and columns. See MDN.

gap?: Responsive<DimensionValue>;

The space to display between columns. See MDN.

columnGap?: Responsive<DimensionValue>;

The space to display between rows. See MDN.

rowGap?: Responsive<DimensionValue>;
}
Referenced by
export interface FlexStyleProps extends BoxAlignmentStyleProps, StyleProps {

The direction in which to layout children. See MDN.

more
less

@default — 'row'

direction?: Responsive<"row" | "column" | "row-reverse" | "column-reverse">;

Whether to wrap items onto multiple lines. See MDN.

more
less

@default — false

wrap?: Responsive<boolean | "wrap" | "nowrap" | "wrap-reverse">;
}
export interface GridStyleProps extends BoxAlignmentStyleProps, StyleProps {

Defines named grid areas. See MDN.

areas?: Responsive<string[]>;

Defines the sizes of each row in the grid. See MDN.

rows?: Responsive<string | DimensionValue[]>;

Defines the sizes of each column in the grid. See MDN.

columns?: Responsive<string | DimensionValue[]>;

Defines the size of implicitly generated columns. See MDN.

autoColumns?: Responsive<DimensionValue>;

Defines the size of implicitly generated rows. See MDN.

autoRows?: Responsive<DimensionValue>;

Controls how auto-placed items are flowed into the grid. See MDN.

autoFlow?: Responsive<"row" | "column" | "row dense" | "column dense">;

Defines the default justifySelf for all items in the grid. See MDN.

justifyItems?: Responsive<"auto" | "normal" | "start" | "end" | "center" | "left" | "right" | "stretch" | "self-start" | "self-end" | "baseline" | "first baseline" | "last baseline" | "safe center" | "unsafe center" | "legacy right" | "legacy left" | "legacy center">;
}
export function forwardRef<T, P = {}>(render: (props: P, ref: Ref<T>) => ReactElement | null): (props: P & RefAttributes<T>) => ReactElement | null
Referenced by
export interface DOMRefValue<T extends HTMLElement = HTMLElement> {
UNSAFE_getDOMNode(): T | null;
}
Referenced by
export interface FocusableRefValue<T extends HTMLElement = HTMLElement, D extends HTMLElement = T> extends DOMRefValue<D> {
focus(): void;
}
Referenced by
export type DOMRef<T extends HTMLElement = HTMLElement> = Ref<DOMRefValue<T>>
export type FocusableRef<T extends HTMLElement = HTMLElement, D extends HTMLElement = T> = Ref<FocusableRefValue<T, D>>
export interface RefObject<T> {
current: T;
}
Referenced by
export type forwardRefType = typeof forwardRef
export type LabelPosition = "top" | "side"
Referenced by
export type Alignment = "start" | "end"
Referenced by
export type NecessityIndicator = "icon" | "label"
Referenced by
export interface LabelableProps {

The content to display as the label.

label?: ReactNode;
}
Referenced by
export interface SpectrumLabelableProps extends LabelableProps {

The label's overall position relative to the element it is labeling.

more
less

@default — 'top'

labelPosition?: LabelPosition;

The label's horizontal alignment relative to the element it is labeling.

more
less

@default — 'start'

labelAlign?: Alignment;

Whether the required state should be shown as an icon or text.

more
less

@default — 'icon'

necessityIndicator?: NecessityIndicator;

Whether the label is labeling a required field or group.

isRequired?: boolean;

A ContextualHelp element to place next to the label.

contextualHelp?: ReactNode;
}
export type Orientation = "horizontal" | "vertical"
export type Direction = "ltr" | "rtl"
}