Tailwind CSS Select - Props

The following props are available for select component. These are the custom props that come with we've added for the select component and you can use all the other native props as well.

AttributeTypeDescriptionDefault
variantVariantChange input variantoutlined
sizeSizeChange input sizemd
colorColorChange input colorblue
labelstringAdd label for input''
errorbooleanChange input state to errorfalse
successbooleanChange input state to successfalse
arrownodeChange select arrow iconundefined
valuestringChange selected value for selectundefined
onChangefunctionReturn selected value when select value changedundefined
selectedfunctionReturn selected element and it's indexundefined
offsetOffsetChange select menu offset from it's input5
dismissDismissChange dismiss listeners when clicking outsideundefined
animateAnimateChange select menu animationundefined
lockScrollbooleanLock page scrolling when select menu is openedfalse
labelPropsobjectAdd custom props for select labelundefined
menuPropsobjectAdd custom props for select menuundefined
disabledbooleanDisable select inputfalse
classNamestringAdd custom className for select input''
childrennodeAdd content for selectNo default value it's a required prop.


For TypeScript Only

import type { SelectProps } from "@material-tailwind/react";

Select Option Props

The following props are available for select option component. These are the custom props that come with we've added for the select option component and you can use all the other native props as well.

AttributeTypeDescriptionDefault
valuestringAdd select option value, it works together with value props of selectundefined
indexnumberAdd select option valueundefined
disabledbooleanDisable select optionfalse
classNamestringAdd custom className for select option''
childrennodeAdd content for select optionNo default value it's a required prop.


For TypeScript Only

import type { SelectOptionProps } from "@material-tailwind/react";

Types - Variant

type variant = "standard" | "outlined" | "static";

Types - Size

type size = "md" | "lg";

Types - Color

type color =
  | "blue-gray"
  | "gray"
  | "brown"
  | "deep-orange"
  | "orange"
  | "amber"
  | "yellow"
  | "lime"
  | "light-green"
  | "green"
  | "teal"
  | "cyan"
  | "light-blue"
  | "blue"
  | "indigo"
  | "deep-purple"
  | "purple"
  | "pink"
  | "red";

Types - Offset

type offset =
  | number
  | {
      mainAxis?: number;
      crossAxis?: number;
      alignmentAxis?: number | null;
    };

Types - Dismiss

type dismiss = {
  enabled?: boolean;
  escapeKey?: boolean;
  referencePointerDown?: boolean;
  outsidePointerDown?: boolean;
  ancestorScroll?: boolean;
  bubbles?: boolean;
};

Types - Animate

type animate = {
  mount?: object;
  unmount?: object;
};
Edit this page on Github