# Wheel Picker URL: /react/components/wheel-picker Source: https://github.com/daangn/seed-design/blob/dev/docs/content/react/components/wheel-picker.mdx A component for selecting one or more values by scrolling items vertically. 사용 가능 버전: @seed-design/react@2.4.0, @seed-design/css@2.6.0 ## Preview ```tsx "use client"; import { Box, Text, VStack } from "@seed-design/react"; import * as React from "react"; import { WheelPicker } from "seed-design/ui/wheel-picker"; const buildingOptions = Array.from({ length: 10 }, (_, index) => { const value = String(101 + index); return { value, label: `Bldg ${value}` }; }); const unitOptions = Array.from({ length: 15 }, (_, floorIndex) => Array.from({ length: 4 }, (_, lineIndex) => { const value = String((floorIndex + 1) * 100 + lineIndex + 1); return { value, label: `Unit ${value}` }; }), ).flat(); export default function WheelPickerPreview() { const [{ building, unit }, setAddress] = React.useState({ building: "103", unit: "1202", }); const columns = [ { id: "building", "aria-label": "Building", options: buildingOptions, value: building, onValueChange: (nextBuilding: string) => setAddress((current) => ({ ...current, building: nextBuilding })), }, { id: "unit", "aria-label": "Unit", options: unitOptions, value: unit, onValueChange: (nextUnit: string) => setAddress((current) => ({ ...current, unit: nextUnit })), }, ]; return ( Bldg {building}, Unit {unit} ); } ``` ## Installation - npm: npx @seed-design/cli@latest add ui:wheel-picker - pnpm: pnpm dlx @seed-design/cli@latest add ui:wheel-picker - yarn: yarn dlx @seed-design/cli@latest add ui:wheel-picker - bun: bun x @seed-design/cli@latest add ui:wheel-picker ## Props ### `WheelPicker` ### `WheelPickerColumn` ## Examples ### Package API ```tsx "use client"; import { Box, Text, VStack, WheelPicker } from "@seed-design/react"; import * as React from "react"; const options = ["작게", "보통", "크게"].map((label) => ({ value: label, label })); export default function WheelPickerPackageApi() { const [value, setValue] = React.useState("보통"); return ( ( {option.label} )} /> 선택값: {value} ); } ``` The compound API of `@seed-design/react` is used when combining columns directly. You can adjust the entire or column-level styles with `className` on `Root` and each `Column`. `renderLabel` replaces the default ItemLabel with a returned element. If you need default spacing and alignment, you can recombine `WheelPicker.ItemLabel` as shown in the example. Slot style API for internal items and selection indicators is not provided. ### Value Change `onIndexChange` is called whenever the center item changes due to user scrolling or tapping. Since it passes the index and value of each item traversed in order even before settling, it can be used for per-item haptics. Handle the final selected value with `onValueChange` after scrolling settles. ### React Element Label ```tsx "use client"; import { Box, HStack, Text, VStack } from "@seed-design/react"; import * as React from "react"; import { WheelPicker } from "seed-design/ui/wheel-picker"; function ColorDot({ color }: { color: string }) { return (