A SearchField is a text field designed for searches.
import { SearchField } from '@backstage/ui';
<SearchField />
Prop | Type | Default | Responsive |
---|---|---|---|
size | smallmedium | small | Yes |
label | string | - | No |
icon | ReactNode | - | No |
description | string | - | No |
name | string | - | No |
startCollapsed | boolean | false | No |
className | string | - | No |
style | CSSProperties | - | No |
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>
Here's a simple SearchField with a description.
<SearchField label="Label" description="Description" placeholder="Enter a URL" />
You can make the SearchField collapsible by setting the startCollapsed
prop to true
.
<SearchField startCollapsed />
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.
bui-SearchField
bui-SearchField[data-startCollapsed="true"]
bui-SearchField[data-startCollapsed="false"]
bui-InputClear