一键导入
groww-select
Select dropdown component for single selection from options. Use when user needs to choose one option from a list of predefined choices.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Select dropdown component for single selection from options. Use when user needs to choose one option from a list of predefined choices.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Accordion component with collapsible sections. Use for FAQs, nested content, or expandable details sections.
Button component with variants, sizes, loading states, and icon support. Use when creating clickable actions, forms, or navigation buttons.
Calendar component for date and month selection. Use when building date pickers, scheduling interfaces, or date range selectors.
Carousel component for image/content sliders with navigation controls. Use for image galleries, hero sections, or content that scrolls horizontally.
Checkbox component for boolean or multi-select inputs. Use when building forms with boolean toggles or multiple selection lists.
Dropdown menu component with trigger and content pattern. Use when building selectable menus, action menus, or nested navigation.
| name | groww-select |
| description | Select dropdown component for single selection from options. Use when user needs to choose one option from a list of predefined choices. |
import Select from '@groww-tech/ui-toolkit/dist/esm/components/atoms/Select';
// or
import { Select } from '@groww-tech/ui-toolkit';
interface SelectData {
label: string; // Display text
value: string | number; // Option value
subContent?: React.ReactNode; // Additional content
}
interface SelectProps {
data: SelectData[]; // Array of options (required)
activeIndex?: number; // Currently selected index
onSelect: (index: number, value: string | number) => void; // Selection handler
placeholder?: string; // Placeholder when nothing selected
disabled?: boolean; // Disable the select
showSearch?: boolean; // Show search input
searchValue?: string; // Controlled search value
onSearchChange?: (value: string) => void; // Search change handler
className?: string;
dataTestId?: string;
id?: string;
name?: string;
}
const options = [
{ label: 'Option 1', value: '1' },
{ label: 'Option 2', value: '2' },
{ label: 'Option 3', value: '3' },
];
<Select
data={options}
activeIndex={selectedIndex}
onSelect={(index, value) => {
setSelectedIndex(index);
setValue(value);
}}
/>
<Select
data={options}
activeIndex={selectedIndex}
onSelect={handleSelect}
placeholder="Select an option"
/>
<Select
data={options}
activeIndex={selectedIndex}
onSelect={handleSelect}
showSearch={true}
searchValue={searchQuery}
onSearchChange={setSearchQuery}
/>
const [selectedIndex, setSelectedIndex] = useState(-1);
<Select
data={options}
activeIndex={selectedIndex}
onSelect={(index, value) => setSelectedIndex(index)}
/>