Collapsible Search
A button that expands into a pill-shaped search form. Accepts all standard button parameters to configure the trigger appearance.
Default / Medium (md)
@collapsibleSearch([
'button' => [
'text' => 'Search',
'icon' => ['name' => 'search'],
'style' => 'filled',
'color' => 'default',
'size' => 'md',
],
])
@endcollapsibleSearch
Small (sm)
@collapsibleSearch([
'button' => [
'text' => 'Search',
'icon' => ['name' => 'search'],
'style' => 'filled',
'color' => 'default',
'size' => 'sm',
],
])
@endcollapsibleSearch
Large (lg)
@collapsibleSearch([
'button' => [
'text' => 'Search',
'icon' => ['name' => 'search'],
'style' => 'filled',
'color' => 'default',
'size' => 'lg',
],
])
@endcollapsibleSearch
Pre-expanded state
@collapsibleSearch([
'button' => [
'text' => 'Search',
'icon' => ['name' => 'search'],
'style' => 'filled',
'color' => 'default',
'size' => 'md',
],
'isExpanded' => true,
'placeholder' => 'Type to search…',
])
@endcollapsibleSearch
Inside a header
Primary colour trigger
@collapsibleSearch([
'button' => [
'text' => 'Search',
'icon' => ['name' => 'search'],
'style' => 'filled',
'color' => 'primary',
'size' => 'md',
],
])
@endcollapsibleSearch
API
| Parameter | Default | Description |
|---|---|---|
|
button
|
[] | Button component configuration array. Accepts all standard button parameters (text, icon, size, color, style, shape, etc.). Merged directly into the trigger button. |
|
placeholder
|
Search… | Placeholder text inside the search input. |
|
inputName
|
s | Name attribute for the search input (used in query string). |
|
inputLabel
|
Search | Accessible label for the search input. |
|
action
|
Form action URL. Defaults to current page. | |
|
method
|
get | Form submission method; get or post. |
|
closeLabel
|
Close search | Accessible label for the close button. |
|
isExpanded
|
false | Render the component in its expanded state on load. |
|
lang
|
[] | Translatable string overrides. |
CSS API
| Variable | Default | Type | Values | Description |
|---|---|---|---|---|
|
--c-collapsible-search--base
|
var(--base) | range | - | Main unit that drives radius and spacing scales. |
|
--c-collapsible-search--border-radius
|
var(--border-radius) | range | - | Border Radius |
|
--c-collapsible-search--border-width
|
var(--border-width) | range | - | Size |
|
--c-collapsible-search--space
|
var(--space) | range | - | Base spacing unit. Used for padding and margin inside components. |
|
--c-collapsible-search--color--surface
|
var(--color--surface) | color | - | Controls the search field background and its readable text contrast. |
|
--c-collapsible-search--color--surface-contrast
|
var(--color--surface-contrast) | color | - | Used for text and icons on surface backgrounds with less contrast. |
|
--c-collapsible-search--color--surface-contrast-muted
|
var(--color--surface-contrast-muted) | color | - | Derived muted contrast for text and icons on surface backgrounds. |
|
--c-collapsible-search--color--primary
|
var(--color--primary) | color | - | Controls the field outline that separates it from the panel. |
|
--c-collapsible-search--color--secondary
|
var(--color--secondary) | color | - | Controls the surrounding panel and close-button color scheme. |
|
--c-collapsible-search--color--secondary-contrast
|
var(--color--secondary-contrast) | color | - | Secondary Contrast |
|
--c-collapsible-search--corner-shape
|
var(--corner-shape) | select | square, round, squircle, circular, bevel, scoop | Corner Shape |
|
--c-collapsible-search--font-size-90
|
var(--font-size-90) | range | - | One step below base in the type scale. |
|
--c-collapsible-search--font-size-100
|
var(--font-size-100) | range | - | Base font size. |
|
--c-collapsible-search--font-size-200
|
var(--font-size-200) | range | - | One step above base in the type scale. Equivalent to h6/subtitle. |
|
--c-collapsible-search--input-min-width-multiplier
|
20 | range | - | Minimum desktop field width, measured in base units. |
|
--c-collapsible-search--input-max-width-multiplier
|
40 | minmaxrange | - | Maximum desktop field width, measured in base units. |
|
--c-collapsible-search--item-size-multiplier
|
6 | range | - | Scales the field and its action buttons together, measured in base units. |
|
--c-collapsible-search--padding-inline-multiplier
|
2 | range | - | Adjusts the field's horizontal inset, measured in space units. |
|
--c-collapsible-search--border-width-multiplier
|
2 | range | - | Scales the field border thickness locally while keeping the search action aligned to its edge. |
|
--c-collapsible-search--motion-duration-multiplier
|
1 | range | - | A lower value makes the sequence faster; a higher value makes it more deliberate. |