Tessina UI
ConfiguratorGitHubIntroduction
InstallationUsageTheming
ComponentsAccordionAction SheetAlertAlertDialogArea ChartAspectRatioAvatarBadgeBannerBar ChartBottom NavBreadcrumbButtonButtonGroupCalendarCardCarouselChartChatBubbleCheckboxChipCodeBlockCollapsibleColor PickerComboboxCommandContainerContextMenuDate PickerDividerDrawerDropdown MenuEmptyStateFABFieldFieldsetFile UploadFile Upload 2FlexFormGridHoverCardIconButtonLabelLine ChartLinkMenubarMeterModalNavigation MenuNumberFieldOTP InputPaginationPie ChartPopoverProgressPromptInputRadar ChartRadial ChartRadioRatingScroll AreaSearchSegmentedControlSelectShortcutSidebarSkeletonSliderSpacerSpinnerSplit ButtonStackStatusStepperSurfaceSwitchTableTabsTextareaTime PickerToastToggleButtonToggleGroupToolbarTooltipTop Header DesktopTop Header Mobile
Contributing
Components

Search

A search input with built-in search icon, clear button, optional submit button, loading state, and full RTL support. Follows the Field component's design language with three visual variants.

Playground

Installation

pnpm add @tessinaui/ui

Usage

import { Search } from "@tessinaui/ui";
<Search placeholder="Search..." onSearch={(value) => console.log(value)} />

The search component wraps a native <input type="search"> inside a <form role="search"> landmark for proper accessibility. It automatically provides a search icon, handles Escape to clear, and Enter to submit.

Examples

Default

The simplest search field with a built-in search icon and clear button.

Variants

Three visual styles — default (bordered), filled (background), and minimal (bottom border only).

Sizes

Five sizes from xs to xl, controlling height, padding, and icon scale.

Intents

Use intent with supportingText to convey error, warning, success, and info feedback.

With Submit Button

Set showSubmitButton to render a submit button inside the field.

Keyboard Shortcut

Enable showShortcut to display a ⌘K hint and register a global focus shortcut.

API Reference

Props

PropTypeDefaultDescription
variant"default" | "filled" | "minimal""default"Visual variant. default has a border, filled has a background, minimal has only a bottom border
size"xs" | "sm" | "md" | "lg" | "xl""md"Controls height, padding, and text/icon size
rounded"full" | "lg" | "md" | "sm" | "none""full"Border radius. Ignored for minimal variant
intent"none" | "error" | "warning" | "success" | "info""none"Controls border/ring color and supporting text styling
labelstring--Label text above the search field
requiredbooleanfalseShows a red * after the label and sets aria-required
supportingTextstring--Text below the input. Color and icon follow intent
searchLabelstring"Search"Accessible label for the search form landmark (aria-label)
clearablebooleantrueShows a clear button when the input has a value
onClear() => void--Called when the clear button is clicked
onSearch(value: string) => void--Called when the user presses Enter or clicks the submit button
showSubmitButtonbooleanfalseShows a submit button inside the search field
submitButtonTextstring"Search"Text for the submit button
loadingbooleanfalseShows a loading spinner instead of the search icon
showShortcutbooleanfalseShows ⌘K hint when empty, Esc when dirty. Registers a global Cmd/Ctrl+K listener to focus the input
disabledbooleanfalseDisables the input and all interactive elements
dir"ltr" | "rtl"--Text direction. RTL flips the full layout
placeholderstring"Search..."Native placeholder text
value / defaultValuestring--Controlled / uncontrolled value
onChangeChangeEventHandler--Native onChange handler
wrapperClassNamestring--Extra className for the outer <form> element
containerClassNamestring--Extra className for the bordered container <div>

All other native <input> attributes (name, autoComplete, autoFocus, etc.) are forwarded.

Keyboard Interactions

KeyAction
EnterSubmits the search (calls onSearch)
EscapeClears the input value
⌘K / Ctrl+KFocuses the search input (when showShortcut is enabled)

Accessibility

  • Wrapped in a <form role="search"> landmark with aria-label
  • Uses native <input type="search"> with role="searchbox"
  • aria-required and aria-invalid set from props
  • Clear button uses aria-label="Clear search"
  • Focus ring follows WCAG 2.1 AA: focus-visible:ring-2
  • Touch targets meet 44x44px minimum

Scroll Area

A scrollable container with custom overlay scrollbars that do not steal layout space. Supports vertical, horizontal, and both-axis content with a neutral branded thumb, RTL, and a compound API for full control.

SegmentedControl

A radio-group style control where one segment is selected at a time, with outline, filled, and pill variants, horizontal and vertical orientations, and full keyboard navigation

On this page

PlaygroundInstallationUsageExamplesDefaultVariantsSizesIntentsWith Submit ButtonKeyboard ShortcutAPI ReferencePropsKeyboard InteractionsAccessibility