Select is used to pick a value from a list of options.
Class name
Type
Description
select
Component
For <select> element
select-ghost
Style
ghost style
select-neutral
Color
neutral color
select-primary
Color
primary color
select-secondary
Color
secondary color
select-accent
Color
accent color
select-info
Color
info color
select-success
Color
success color
select-warning
Color
warning color
select-error
Color
error color
select-xs
Size
Extra small size
select-sm
Size
Small size
select-md
Size
Medium size
select-lg
Size
Large size
select-xl
Size
Extra large size
Select
<selectclass="select"><optiondisabled=""selected="">Pick a color</option><option>Crimson</option><option>Amber</option><option>Velvet</option></select>
<selectclass="select select-ghost"><optiondisabled=""selected="">Pick a font</option><option>Inter</option><option>Poppins</option><option>Raleway</option></select>
<fieldsetclass="fieldset"><legendclass="fieldset-legend">Browsers</legend><selectclass="select"><optiondisabled=""selected="">Pick a browser</option><option>Chrome</option><option>FireFox</option><option>Safari</option></select><spanclass="label">Optional</span></fieldset>
<selectclass="select select-primary"><optiondisabled=""selected="">Pick a text editor</option><option>VScode</option><option>VScode fork</option><option>Another VScode fork</option></select>
Select( [ option([Component.text('Pick a text editor')], selected: true, disabled: true), option([Component.text('VScode')]), option([Component.text('VScode fork')]), option([Component.text('Another VScode fork')]), ], color: SelectColor.primary,);
Secondary color
<selectclass="select select-secondary"><optiondisabled=""selected="">Pick a language</option><option>Zig</option><option>Go</option><option>Rust</option></select>
<selectclass="select select-info"><optiondisabled=""selected="">Pick a Framework</option><option>React</option><option>Vue</option><option>Angular</option></select>
<selectclass="select select-success"><optiondisabled=""selected="">Pick a Runtime</option><option>npm</option><option>Bun</option><option>yarn</option></select>
<selectclass="select select-warning"><optiondisabled=""selected="">Pick an OS</option><option>Windows</option><option>MacOS</option><option>Linux</option></select>
<selectclass="select select-error"><optiondisabled=""selected="">Pick an AI Model</option><option>GPT-4</option><option>Claude</option><option>Llama</option></select>
Select( [ option([Component.text('Pick an AI Model')], selected: true, disabled: true), option([Component.text('GPT-4')]), option([Component.text('Claude')]), option([Component.text('Llama')]), ], color: SelectColor.error,);
<selectclass="select appearance-none"><optiondisabled=""selected="">Pick a color</option><option>Crimson</option><option>Amber</option><option>Velvet</option></select>
<selectclass="select [&::picker(select)]:max-h-26"><optiondisabled=""selected="">Pick a color</option><option>Crimson</option><option>Amber</option><option>Velvet</option></select>