Select 8

PreviousNext

A native select dropdown with overlapping label design

Docs
shadcn-studiocomponent

Preview

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

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

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

  return (
    <div className='group relative w-full max-w-xs'>
      <label
        htmlFor={id}
        className='bg-background text-foreground absolute top-0 left-2 z-10 block -translate-y-1/2 px-1 text-xs font-medium group-has-[select:disabled]:opacity-50'
      >
        Native select with overlapping label
      </label>
      <SelectNative id={id}>
        <option value='1'>Developer</option>
        <option value='2'>Designer</option>
        <option value='3'>Manager</option>
        <option value='4'>QA Engineer</option>
      </SelectNative>
    </div>
  )
}

export default NativeSelectWithOverlappingLabelDemo

Installation

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

Usage

import { Select08 } from "@/components/select-08"
<Select08 />