@component-hook/picker
@component-hook/picker
Picker component with vue3 and react.
Features
- Supports
single-columnandcascadepicker - Scroll wheel 3D effect for smooth selection
- Flexible column structure for different use cases
- Built-in
DatePickerandTimePickercomponents - Full TypeScript support
Documentation
For detailed documentation and usage examples, please visit: Official Docs.
Installation
# Using npm
$ npm install @component-hook/picker
# Using yarn
$ yarn add @component-hook/picker
# Using pnpm
$ pnpm install @component-hook/picker
Base Usage
Vue3
<script setup lang="ts">
import { Picker } from '@component-hook/picker/vue';
import { ref } from 'vue';
const pickerValues = ref<number[]>([]);
const columns = Array.from({ length: 50 }, (_, index) => ({ label: index, value: index }));
function onChange(value: number[]) {
pickerValues.value = value;
}
</script>
<template>
<picker
:columns="columns"
@change="onChange"
/>
<p class="mt-6 text-sm font-mono">Selected value: {{ pickerValues.join('') || 'not selected yet' }}</p>
</template>
React
import { Picker } from '@component-hook/picker/react';
import { useState } from 'react';
const columns = Array.from({ length: 50 }, (_, index) => ({ label: index, value: index }));
export function BasePicker() {
const [pickerValues, setPickerValues] = useState<number[]>([]);
return (
<>
<Picker
columns={columns}
onChange={setPickerValues}
/>
<p>Selected value: {pickerValues.join('') || 'not selected yet'}</p>
</>
);
}
License
This project is licensed under the MIT License.
Related Packages
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 1.7.0 | ^3.5.44 | MIT | |
| 1.6.0 | ^3.5.43 | MIT | |
| 1.5.1 | ^3.5.41 | MIT | |
| 1.5.0 | ^3.5.39 | MIT | |
| 1.4.4 | ^3.5.28 | MIT | |
| 1.4.3 | ^3.5.28 | MIT | |
| 1.4.2 | ^3.5.26 | MIT | |
| 1.4.1 | ^3.5.26 | MIT | |
| 1.4.0 | ^3.5.26 | MIT | |
| 1.3.2 | ^3.5.23 | MIT | |
| 1.3.1 | ^3.5.23 | MIT | |
| 1.3.0 | ^3.4.29 | MIT | |
| 1.2.2 | ^3.4.29 | MIT | |
| 1.2.1 | ^3.4.29 | MIT | |
| 1.2.0 | ^3.4.29 | MIT | |
| 1.1.5 | ^3.4.29 | MIT | |
| 1.1.4 | ^3.4.29 | MIT | |
| 1.1.3 | ^3.4.29 | MIT | |
| 1.1.2 | ^3.4.29 | MIT | |
| 1.1.1 | ^3.4.29 | MIT | |
| 1.1.0 | ^3.4.29 | MIT | |
| 1.0.4 | ^3.4.29 | MIT | |
| 1.0.3 | ^3.4.29 | MIT | |
| 1.0.2 | ^3.4.29 | MIT | |
| 1.0.1 | ^3.4.29 | MIT | |
| 1.0.0 | ^3.4.29 | MIT | |
| 0.2.5 | ^3.4.29 | MIT | |
| 0.2.4 | ^3.4.29 | MIT | |
| 0.2.3 | ^3.4.29 | MIT | |
| 0.2.2 | ^3.4.29 | MIT |
Showing the latest 30 of 39. See every release on npm
Pre-releases (13)
| Version | Released | Vue | License |
|---|---|---|---|
| 1.2.1-alpha.0 | ^3.4.29 | MIT | |
| 1.2.0-alpha.0 | ^3.4.29 | MIT | |
| 1.1.5-alpha.0 | ^3.4.29 | MIT | |
| 1.0.2-alpha.1 | ^3.4.29 | MIT | |
| 1.0.2-alpha.0 | ^3.4.29 | MIT | |
| 1.0.1-alpha.0 | ^3.4.29 | MIT | |
| 1.0.0-alpha.1 | ^3.4.29 | MIT | |
| 1.0.0-alpha.0 | ^3.4.29 | MIT | |
| 0.2.4-alpha.0 | ^3.4.29 | MIT | |
| 0.2.1-alpha.0 | ^3.4.29 | MIT | |
| 0.2.0-alpha.0 | ^3.4.29 | MIT | |
| 0.1.2-alpha.1 | ^3.4.29 | MIT | |
| 0.1.2-alpha.0 | ^3.4.29 | MIT |