Version 0.7.0 - Alpha
SearchField
component

SearchField

A SearchField is a text field designed for searches.

Usage

import { SearchField } from '@backstage/ui';

<SearchField />

API reference

PropTypeDefaultResponsive
size
smallmedium
smallYes
label
string
-No
icon
ReactNode
-No
description
string
-No
name
string
-No
startCollapsed
boolean
falseNo
className
string
-No
style
CSSProperties
-No

Examples

Sizes

We support two different sizes: small, medium.

<Flex direction="row" gap="4">
  <SearchField size="small" placeholder="Small" icon={<Icon name="sparkling" />} />
  <SearchField size="medium" placeholder="Medium" icon={<Icon name="sparkling" />} />
</Flex>

With description

Here's a simple SearchField with a description.

Description
<SearchField label="Label" description="Description" placeholder="Enter a URL" />

Collapsible

You can make the SearchField collapsible by setting the startCollapsed prop to true.

<SearchField startCollapsed />

Theming

Our theming system is based on a mix between CSS classes, CSS variables and data attributes. If you want to customise this component, you can use one of these class names below.

Changelog