Skip to main content
PROYECTOVIVIANA

SearchField

The props declared for SearchField, generated from the types @proyecto-viviana/ui ships.

Import

import { SearchField } from "@proyecto-viviana/ui";

Props

Differs from @proyecto-viviana/solid-spectrum
  • prefix exists only here.
  • suffix exists only here.
  • shortcut exists only here.
Props for SearchField in @proyecto-viviana/ui
PropTypeDefaultDescription
size'S' | 'M' | 'L' | 'XL' | 'sm' | 'md' | 'lg'—The size of the search field.
variant'filled' | 'outline'—Legacy visual variant. S2 SearchFields do not expose visual variants.
stylesStyleString—Spectrum-defined generated classes.
UNSAFE_classNamestring—Additional CSS class name. Use only as a last resort.
UNSAFE_styleJSX.CSSProperties—Additional inline styles. Use only as a last resort.
classstring—Backward-compatible class alias. Prefer UNSAFE_className for S2 parity.
labelnumber | boolean | RenderedElement | ArrayElement | (string & {}) | Node | JSX.ArrayElement—Label text for the input.
descriptionnumber | boolean | RenderedElement | ArrayElement | (string & {}) | Node | JSX.ArrayElement—Description text shown below the input.
errorMessagenumber | boolean | RenderedElement | ArrayElement | (string & {}) | Node | JSX.ArrayElement—Error message shown when invalid.
labelPosition'top' | 'side'—Position of the label relative to the input.
labelAlign'start' | 'end'—Text alignment for side labels.
necessityIndicator'label' | 'icon'—Whether required fields show an icon or text label.
contextualHelpnumber | boolean | RenderedElement | ArrayElement | (string & {}) | Node | JSX.ArrayElement—A contextual help element to place next to the label.
prefixnumber | boolean | RenderedElement | ArrayElement | (string & {}) | Node | JSX.ArrayElement—An icon or text rendered before the input in place of the built-in search magnifier, e.g. the register's `/` slash-command glyph.
suffixnumber | boolean | RenderedElement | ArrayElement | (string & {}) | Node | JSX.ArrayElement—An icon or text rendered after the input, e.g. a key hint.
shortcutstring—A keyboard shortcut hint drawn as a key chip at the end of the field, e.g. `"⌘K"`. Local addition — no S2 counterpart. The register parks the shortcut that focuses the field INSIDE the well (TerminalGlassLab.tsx:157), where a sibling element cannot reach; S2 has no slot for it. Deliberately NOT routed through `suffix`. A suffix is part of the field's accessible name — its id is appended to the input's `aria-labelledby`, which is right for a unit ("kg") and wrong for a shortcut: a screen-reader user would hear "Search lessons ⌘K" as the field's name. The chip is `aria-hidden` decoration; the shortcut itself is announced only if the app describes it (`aria-describedby`).
slotstring—Slot name when used in a Spectrum context.
refHTMLDivElement | ((el: HTMLDivElement) => void) | { current?: HTMLDivElement | null | undefined; }—Ref for the search field root element.
idstring—The element's unique identifier. solidaria
onBeforeInputJSX.EventHandler<HTMLInputElement | HTMLTextAreaElement, InputEvent>—Not yet documented solidaria
onBlur(e: FocusEvent) => void—Handler that is called when the element loses focus. solidaria
onChange(value: string) => void—Handler called when the value changes. solidaria-components
onCompositionEndJSX.EventHandler<HTMLInputElement | HTMLTextAreaElement, CompositionEvent>—Not yet documented solidaria
onCompositionStartJSX.EventHandler<HTMLInputElement | HTMLTextAreaElement, CompositionEvent>—Not yet documented solidaria
onCompositionUpdateJSX.EventHandler<HTMLInputElement | HTMLTextAreaElement, CompositionEvent>—Not yet documented solidaria
onCopyJSX.EventHandler<HTMLInputElement | HTMLTextAreaElement, ClipboardEvent>—Not yet documented solidaria
onCutJSX.EventHandler<HTMLInputElement | HTMLTextAreaElement, ClipboardEvent>—Not yet documented solidaria
onFocus(e: FocusEvent) => void—Handler that is called when the element receives focus. solidaria
onInputJSX.EventHandler<HTMLInputElement | HTMLTextAreaElement, InputEvent>—Not yet documented solidaria
onKeyDown(e: KeyboardEvent) => void—Handler that is called when a key is pressed. solidaria
onKeyUp(e: KeyboardEvent) => void—Handler that is called when a key is released. solidaria
onPasteJSX.EventHandler<HTMLInputElement | HTMLTextAreaElement, ClipboardEvent>—Not yet documented solidaria
onSelectJSX.EventHandler<HTMLInputElement | HTMLTextAreaElement, Event>—Not yet documented solidaria
onSubmit(value: string) => void—Handler called when the user submits the search. solidaria-components
aria-activedescendantstring—Identifies the currently active element when focus is on the textbox. solidaria
aria-autocomplete'none' | 'list' | 'inline' | 'both'—How predictions of the user's intended value are presented. solidaria
aria-controlsstring—Identifies the element whose contents or presence the text field controls. solidaria
aria-describedbystring—Identifies the element (or elements) that describes the object. solidaria
aria-detailsstring—Identifies the element (or elements) that provide a detailed, extended description for the object. solidaria
aria-errormessagestring—Identifies the element that provides an error message for the object. solidaria
aria-haspopupfalse | true | 'true' | 'false' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog'—The kind of popup the text field can open. solidaria
aria-labelstring—Defines a string value that labels the current element. solidaria
aria-labelledbystring—Identifies the element (or elements) that labels the current element. solidaria
isDisabledfalse | true—Whether the input is disabled. solidaria
autoFocusfalse | true—Whether the element should receive focus on mount. solidaria
typestring—The type of input to render. solidaria
formstring—Associates the input with a form element by id. solidaria
namestring—The name of the input element, used when submitting an HTML form. solidaria
valuestring—The current value (controlled). solidaria-components
excludeFromTabOrderfalse | true—Whether to exclude the element from the sequential tab order. solidaria
onFocusChange(isFocused: boolean) => void—Handler that is called when the element's focus status changes. solidaria
validationState'valid' | 'invalid'—Legacy validation state. Kept as a `createSlotId` dependency so a description/error slot is re-probed when this flips, matching RAC `useField` (`useField.ts:38-48`). solidaria
defaultValuestring—The default value (uncontrolled). solidaria-components
isReadOnlyfalse | true—Whether the input is read only. solidaria
isInvalidfalse | true—Whether the input value is invalid. solidaria
isRequiredfalse | true—Whether the input is required. solidaria
validationBehavior'aria' | 'native'—Whether to use native HTML form validation or ARIA validation semantics. solidaria
validate(value: any) => string | string[] | true | null | undefined—A function that returns an error message if a given value is invalid. solidaria
placeholderstring—Placeholder text for the input. solidaria
autoCompletestring—Whether to enable auto complete. solidaria
patternstring—Regex pattern to validate the input value. solidaria
autoCapitalize'none' | 'on' | 'off' | 'sentences' | 'words' | 'characters'—Controls whether and how text input is automatically capitalized. solidaria
onClear() => void—Handler called when the field is cleared. solidaria-components
inputMode'none' | 'search' | 'text' | 'url' | 'tel' | 'email' | 'numeric' | 'decimal'—The input mode hint for virtual keyboards. solidaria
enterKeyHint'search' | 'enter' | 'done' | 'go' | 'next' | 'previous' | 'send'—Hint for the enter key action on virtual keyboards. solidaria
maxLengthnumber—The maximum number of characters supported by the input. solidaria
minLengthnumber—The minimum number of characters required by the input. solidaria
autoCorrectstring—Whether to enable auto correct. solidaria
spellCheck'true' | 'false'—Whether to enable spell check. solidaria
inputElementType'input' | 'textarea'—The element type to use for the input. Defaults to 'input'. solidaria
labelElementType'label' | 'div' | 'span''label'The HTML element used to render the label, e.g. 'label', or 'span'. solidaria

Declared in packages/viviana-ui/src/searchfield/index.tsx.

Props marked solidaria or solidaria-components come from the headless layer underneath and behave the same in both registers. Components that wrap a DOM element also accept that element's standard attributes, which are left out here on purpose — listing them would bury the props that are actually ours.