You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<tr><td><code>searchText</code></td><td><code>Binding<String></code></td><td>Bound text for the search input.</td></tr>
149
-
<tr><td><code>isDropdownVisible</code></td><td><code>Binding<Bool></code></td><td>Controls dropdown list visibility.</td></tr>
150
-
<tr><td><code>options</code></td><td><code>[String]</code></td><td>Source list of selectable values.</td></tr>
151
-
<tr><td><code>placeholder</code></td><td><code>String</code></td><td>Placeholder text when input is empty.</td></tr>
152
-
<tr><td><code>addNew</code></td><td><code>Bool</code></td><td>Allow creating a new item when not found.</td></tr>
153
-
<tr><td><code>onTap</code></td><td><code>() -> Void</code></td><td>Called when the dropdown field becomes active.</td></tr>
154
-
<tr><td><code>textColor</code></td><td><code>Color</code></td><td>Text color for input and items.</td></tr>
155
-
<tr><td><code>placeholderColor</code></td><td><code>Color</code></td><td>Color used for placeholder text.</td></tr>
156
-
<tr><td><code>accentColor</code></td><td><code>Color</code></td><td>Accent color for highlights and icon.</td></tr>
157
-
<tr><td><code>successColor</code></td><td><code>Color</code></td><td>Color used to indicate selection success.</td></tr>
158
-
<tr><td><code>destructiveColor</code></td><td><code>Color</code></td><td>Optional color for destructive actions.</td></tr>
159
-
<tr><td><code>borderColor</code></td><td><code>Color?</code></td><td>Custom border color; computed by component if <code>nil</code>.</td></tr>
160
-
<tr><td><code>font</code></td><td><code>Font</code></td><td>Font used for input and option rows.</td></tr>
161
-
<tr><td><code>height</code></td><td><code>CGFloat</code></td><td>Height of the main input field.</td></tr>
162
-
<tr><td><code>cornerRadius</code></td><td><code>CGFloat</code></td><td>Corner radius for the field background.</td></tr>
163
-
<tr><td><code>dropdownIcon</code></td><td><code>Image</code></td><td>Custom icon for the dropdown indicator.</td></tr>
164
-
<tr><td><code>noMatchText</code></td><td><code>String</code></td><td>Text shown when no results are found.</td></tr>
165
-
<tr><td><code>addNewTextFormat</code></td><td><code>String</code></td><td>Format string used for the Add New button (use <code>%@</code> for the typed text).</td></tr>
166
-
</tbody>
167
-
</table>
168
-
169
-
<p>Example with custom styling:</p>
170
-
171
-
<pre><code>SearchableMenu(
172
-
searchText: $searchText,
173
-
isDropdownVisible: $isDropdownVisible,
174
-
options: ["Swift", "Kotlin", "Dart", "Java"],
175
-
placeholder: "Select language",
176
-
addNew: true,
177
-
onTap: {
178
-
print("Dropdown opened")
179
-
},
180
-
textColor: .black,
181
-
placeholderColor: .gray,
182
-
accentColor: .blue,
183
-
successColor: .green,
184
-
borderColor: .blue,
185
-
font: .system(size: 14, weight: .medium),
186
-
height: 44,
187
-
cornerRadius: 10,
188
-
dropdownIcon: Image(systemName: "chevron.down"),
189
-
noMatchText: "No results found",
190
-
addNewTextFormat: "Add \"%@\""
191
-
)</code></pre>
192
-
</section>
53
+
}
54
+
```
193
55
194
-
<section class="card">
195
-
<h2>Filtering Logic</h2>
196
-
<p>The built-in filtering prioritizes results in this order:</p>
197
-
<ol>
198
-
<li>Exact match</li>
199
-
<li>Prefix match</li>
200
-
<li>Contains match</li>
201
-
</ol>
202
-
<p>This ordering surfaces the most relevant items first.</p>
203
-
</section>
56
+
### Full Initializer
57
+
For customization, you can use all available parameters:
204
58
205
-
<section class="card">
206
-
<h2>Notes on Fonts and Resources</h2>
207
-
<p>
208
-
If you bundle custom fonts inside the Swift package, ensure fonts are placed under the package resource folder:
Register fonts programmatically using <code>CTFontManagerRegisterFontsForURL</code> from your package so <code>Font.custom(...)</code> works in consumer apps.
0 commit comments