Select 2

PreviousNext

A native select dropdown with placeholder text for user guidance

Docs
shadcn-studiocomponent

Preview

Loading preview…
registry/new-york/components/select/select-02.tsx
import { useId } from 'react'

import { Label } from '@/registry/new-york/ui/label'
import { SelectNative } from '@/registry/new-york/ui/select-native'

const SelectNativePlaceholderDemo = () => {
  const id = useId()

  return (
    <div className='w-full max-w-xs space-y-2'>
      <Label htmlFor={id}>Native select with placeholder</Label>
      <SelectNative id={id} defaultValue=''>
        <option value='' disabled>
          Please select a gender
        </option>
        <option value='1'>Male</option>
        <option value='2'>Female</option>
        <option value='3'>Other</option>
      </SelectNative>
    </div>
  )
}

export default SelectNativePlaceholderDemo

Installation

npx shadcn@latest add @shadcn-studio/select-02

Usage

import { Select02 } from "@/components/select-02"
<Select02 />