Component

Select native

安装 Installation

npx timkit add select-native --yes --framework react

用法 Usage

import { SelectNative } from "@/components/ui/select-native"

className 与 variant、size 可以一起用。字段以 timkit agent inspect select-native --json 的 props 为准。

示例

Examples

一次看一个示例。左侧按名称筛选,预览里可切换源码和框架。

15 / 15

Select · With label · 01

Loading preview...

结构化 API

Structured API

与 UCS schema 对齐的 props、逻辑机与多框架运行时。

Component

select-native

Logic

none

Runtime Frameworks

ReactVueWeappHTML

Supported Platforms

WebWeChat Mini Program

Configuration

PropTypeDefaultDescription
logic.provider*
enum (zag | native | none)
noneState and interaction provider used by this component.
logic.machine
string
-Underlying state machine identifier when provider is zag.
platforms*
array
Web, WeChat Mini ProgramPlatforms officially supported by this schema.
frameworks*
array
React, Vue, Weapp, HTMLFramework demos/code currently available in registry files.
dependencies
array
@timui/coreRuntime package dependencies required by this registry item.
optionalPeerDependencies
array
lucide-reactOptional peer dependencies used by this registry item.
registryDependencies
array
-Dependent Timkit registry components/hook entries.

Props

PropTypeDefaultDescription
defaultValue
string
-The initial value of the select. Use string[] when multiple is true.
multiple
boolean
falseWhether multiple options can be selected.
disabled
boolean
falseWhen true, selection changes are ignored.
value
string
-The value of the select. Use string[] when multiple is true.

Events

PropTypeDefaultDescription
onValueChange
event
-Event handler called when the value changes.

TypeScript

来自 TypeScript 导出。

PropTypeDefaultDescription
options
string
-Input behavior configuration for options.
modelValue
string
-The controlled value bound via `v-model` (Vue specific).

Slots

PropTypeDefaultDescription
default
slot
-The option elements

Parts

PropTypeDefaultDescription
root*
root
-The select wrapper
select
part
-The native select element
This API reference is generated from `/packages/core` component schemas to keep React/Vue/Weapp docs consistent.

该组件尚无扩展说明文档。

键盘与焦点

Keyboard

跨 React、Vue 与小程序共享的交互与可读名称约定。

  • One selected option is visible as Option N of the option count.
  • Several selected options read how many are selected.
  • An empty value has no option status.
  • On the mini program, the single select and each option in a multiple select are in the tab order unless the select is disabled.
  • In static HTML, the selected option is visible as Option 1 of 2.
  • In static HTML, a label named Options names the select.
  • On the mini program, an empty description is left off.
  • On the mini program, each option in a multiple select sets aria-disabled when the select is disabled.