Select 6

PreviousNext

A required native select dropdown with asterisk indicator

Docs
shadcn-studiocomponent

Preview

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

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

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

  return (
    <div className='w-full max-w-xs space-y-2'>
      <Label htmlFor={id} className='gap-1'>
        Required native select <span className='text-destructive'>*</span>
      </Label>
      <SelectNative id={id} required>
        <option value='1'>Action</option>
        <option value='2'>Comedy</option>
        <option value='3'>Romance</option>
        <option value='4'>Thriller</option>
      </SelectNative>
    </div>
  )
}

export default NativeSelectRequiredDemo

Installation

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

Usage

import { Select06 } from "@/components/select-06"
<Select06 />