フォーム v1.0.0

コンボボックス

キーボードナビゲーション付きの検索可能なセレクトドロップダウンコンポーネント。 フォームビルダーモード(Railsフォームオブジェクト利用)とスタンドアロンの両方に対応しています。 入力によるオプション絞り込み、キーボードナビゲーション、カスタムオプション表示などの機能を備えています。

プレビュー & コード

オプション

名前 デフォルト 説明
form FormBuilder nil Rails form builder object (for form builder mode)
attribute Symbol nil Model attribute name (for form builder mode)
name String nil Input name attribute (for standalone mode)
options * Array 必須 Array of options - can be strings, [label, value] pairs, or hashes with :label, :value, and optional :description keys
selected String nil Currently selected value (for standalone mode, auto-detected in form mode)
label String nil Label text (auto-generated from attribute if not provided)
hint String nil Help text displayed below the combobox
placeholder String "Search..." Placeholder text for the search input
empty_message String "No results found" Message shown when no options match the search
required Boolean false Whether a selection is required
disabled Boolean false Whether the combobox is disabled
error String nil Manual error message (auto-detected from form object if not provided)
class String "" Additional CSS classes for the container

変更履歴 v1.0.0

- Initial release with form builder and standalone modes
- Real-time search filtering
- Keyboard navigation (arrow keys, enter, escape)
- Support for option descriptions
- Automatic error detection from Rails form objects
- Dark mode support

フルアクセスを取得

このコンポーネントと他のすべてのソースコードをアンロックしましょう。一回のお支払いで永久アクセス。

今すぐアクセスを取得